Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Concurrency control wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Microsoft SQL Server wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Functional Database Model wikipedia , lookup
Relational model wikipedia , lookup
Oracle Database wikipedia , lookup
Spatial Database GISC 6383 Fall 2005 Bryan Dennie Jian Huang Jianghong Li Judy Mays Table of Contents 1. Introduction 2. Comparison Criteria a. Overview, Cost, and Standards b. GIS Application c. Spatial Data Types d. Query e. Data loading f. Other Criteria (Compatibility with GIS Applications, Server Capability, Stand-Alone or part of System) 3. Summary 4. Appendix I: Oracle Spatial Functions 5. Appendix II: IBM DB2 Spatial Functions 6. References 2 3 4 5 6 7 9 10 11 13 15 16 Introduction At the request of the Retail Manager, the option of performing new store location assessment in-house is being investigated. In order to evaluate prospective locations this company, DFW Stores, Inc., needs to incorporate spatial data to its database systems. Our committee has researched several options and presents the results in this report. Locational data may be integrated with business data by adding spatial capabilities to the database system. Querying and analyzing spatial data requires specialized data types and functions that are provided by the spatial database. Points, lines, and polygons are used to model geographic entities and are referenced to a specific location by means of coordinates such as latitude and longitude. Not only can spatial objects be referenced to each other, but this spatial data may then be related to other conventional business and demographic data within the database. Queries may then be made on this combined data and results viewed in database report format or in map form by means of a visualization tool. The potential spatial databases considered for this project are: IBM DB2 Spatial Extender and Oracle Spatial, both industry-leading database providers; PostGIS, an open-source database that includes some spatial functionality; and ArcSDE, a spatial data engine from ESRI, the market leader in GIS applications. Following is a general introduction that provides an overview of each system. Once a separate extension to IBM DB2 database, Spatial Extender is now integrated within current versions of the database. Spatial information, in formats such as points, lines, and polygons, can be analyzed, generated, stored, accessed, and queried within the spatial database. Oracle Spatial, a paid extension to Oracle Enterprise Edition, offers the possibility to store, update, retrieve and analyze spatial data in and from the database. Central data management is made possible by storing both spatial and traditional data in the same location. PostGIS adds geographic object support to the open-source object-relational database, PostgreSQL. In other words, PostGIS enables PostgreSQL to store, relate, join, query, analyze with spatial data inside the database. ArcSDE is not an extension to a database, but rather middleware, or a server software product. ArcSDE augments the range of data types to include spatial data that can be managed in traditional relational databases like IBM DB2, Oracle, or Microsoft SQL Server. It is the necessary connection for ESRI’s ArcGIS systems, acting as a conduit to applications that perform geographic or spatial analysis as it serves data to users within an organization or to the internet. In the next section, the following topics are used for comparison: cost, standards, GIS applications, spatial data types supported, database queries, spatial functions, data loading, compatibility with GIS applications, and server capability. 3 1. Cost and Standards: Spatial Database Product IBM DB2 spatial extender ArcSDE Oracle Spatial Cost Standards For earlier versions of DB2, cost to add SpatialExtender is $9,250 Conforms to the ISO SQL/MM Spatial Standard and the OpenGIS Consortium's (OGC's) Simple Feature Specification for SQL Now included in DB2v8.1 & higher: IBM DB2 Personal Edition $461 IBM DB2 cost varies with number of licenses: Express Edition $4,874 Enterprise Server Edition $33,125 Starting price is $10,000 for commercial applications. ArcSDE supports OpenGIS simple features and SQL statements. Enterprise Edition: Named user license: $800 Processor license: $40,000 Oracle spatial implements the OpenGIS Consortium Simple Features guidelines. Oracle is also committed to supporting the new OGC Geographic Markup Language (GML) as well as Open Location Service interfaces. Oracle Spatial: Named user license: $200 Processor license: $10,000 PostgreSQL / PostGIS Refractions Research under the GNU General Public License developed PostGIS for open source, free to the public distribution. It and the PostgreSQL database are completely open-source and can be easily downloaded over the internet for free. 4 Version 1.0 of PostGIS is currently under validation of the Open GIS Consortium “Simple Features Specification for SQL” which defines standard GIS object types, the functions required to manipulate them, and a set of metadata tables. 2. GIS Application Spatial Database Product IBM DB2 Spatial Extender GIS Application In 2001 IBM and ESRI partnered and jointly developed the IBM DB2 Spatial Extender, which incorporated geographic or spatial information with business and other data already residing in an IBM Universal Database. Spatial data may be manipulated within the database by utilizing spatial extender functions to return GIS information in tabular format. A separate visualization tool is needed to see a graphic representation such as a map. ArcSDE is a server software product used to access massively large multiuser geographic databases stored in relational database management systems (RDBMSs). ArcSDE It is an integrated part of ArcGIS and a core element of any enterprise GIS solution. Its primary role is to act as the GIS gateway to spatial data stored in a RDBMS. ArcSDE provides a suite of services that enhance data management performance, extend the range of data types that can be stored in a RDBMS, enable schema portability between RDBMSs, and offer configuration flexibility. Oracle Spatial PostgreSQL / PostGIS Oracle Spatial is an extension to Oracle9i that provides geometry storage, indexing, and spatial search functions. When used with Oracle9i Enterprise Edition, Oracle Spatial provides a standards-based data management solution for the delivery of GIS, Internet mapping, and mobile location-based services. It serves as a technology platform for managing an enterprise-wide GIS or location-enabled e-business applications. The software itself is a limited standalone GIS, but there are other open source applications that can be downloaded to enhance it’s GIS capabilities. 5 3. Spatial Data Types: Spatial Database Product IBM DB2 Spatial Extender Spatial Data Type Graphic Points Lines Polygons Ability to “subtype” these basic types Support all the ESRI geometry types ArcSDE SDO_GEOMETRY – can support three geometric primitive types: Geometric Geometric Types Types Point Oracle Spatial PostgreSQL / PostGIS Points. Polygons Line string Arc line string Compound line string SelfSelf-crossing line strings Valid Line Strings (can be linear, curved or both) Polygon Polygon with hole Compound polygon Optimized polygons SelfSelf-crossing polygons Not valid Point, Multipoint Line, Multiline Polygon,,Multipolygon, Geometrycollections 6 4. Query: Spatial Database Product Query Functions 80 built-in spatial data functions IBM DB2 Spatial Extender SQL access to spatial data SQL querying of spatial data and/or joining of spatial data with conventional database or business data 8 geometry type constructor functions 12 spatial data comparison functions 20 geometric conversion functions 40 geometric calculator functions Examples: ST_LineString, ST_Intersects, ST_AsShape, ST_Area ArcSDE The spatial query in ArcSDE and RDBMS client is implemented in the form of SQL statements. Requests for data occur when actions like zooming in/out, querying rows in table, and displaying tabular or spatial data are performed. These types of requests are translated into SQL statements and passed to the RDBMS for processing. 7 All functions depend on the ArcGIS software, such as ArcMap Cont’d 4. Query Spatial Database Product Query Functions Oracle Spatial uses a two-tier process for querying spatial data. Over 400 spatial functions, Oracle Spatial includes functions for length/area calculations, buffer, centroid, convexhull, geometry intersection, union. list the major functions: Oracle Spatial The first part of the query selects candidate rows based only on their spatial index. The second step of the query looks at each candidate and determines if it meets the query exactly. This two-tier approach allows for quick querying by leveraging the spatial indexes. 3 SDO_GEOMETRY object type method 17spatial operators 21 Geometry Function 5 Spatial Aggregate Functions 3 Coordinate System Transformation Functions 40 Linear Referencing Functions 6 Migration Procedures 11 Tuning Functions and Procedures 2 Utility Functions Management Functions AddGeometryColumn, DropGeometryColumn, SetSRID PostgreSQL / PostGIS Spatial queries are performed the same way they are constructed in any other database query. 8 Relate Functions Distance, Equals, Disjoint, Intersects, Touches, Crosses, Within, Overlaps, Contains, Intersects, Relate Processing Functions Centroid, Area, Length, PointOnSurface, Boundary, Buffer, ConvexHull, Intersection, Difference, GeomUnion, Envelope, IsSimple, IsClosed, IsRing, NumPoints, ExteriorRing, NumInteriorRings, EndPoint, StartPoint, GeometryType, X, Y, & Z. 5. Data loading: Spatial Database Product IBM DB2 spatial extender Data Loading Spatial data may be imported into and exported from Spatial Extender through data exchange files. Two types are supported: shapefiles and ESRI SDE transfer files. Also supported are industry standard data types: Well Known Binary (OGC WKB) andd Well Known Text (OGC WKT) ArcSDE Oracle Spatial Raster data: ArcSDE supports the following formats: ERDAS IMAGINE, ERDAS(.lan & .gis), ERDAS Raw, GIF, BIL/BIP/BSQ, BMP, MrSID compressed images, JPEG, ADRG, PNG, ER Mapper, CIB, CADRG. Vector data: shape file, AutoCAD, coverage, tab file for MapInfo etc. Writing SQL statement to create table & load data into the table directly. Convert Shape to SDO 1. Using shp2sdo to create load assistant files 2. Using sqlplus to create table 3. Using sqlldr to load the actual data into the table Other data formats should be converted into shapefile before loading. PostgreSQL / PostGIS Loading data can be done two ways. The first way is using the loader, which converts ESRI Shape files into SQL suitable for loading in PostGIS/PostgreSQL. This is similar to importing data into an ESRI Geodatabase. The other way to get data into the database are converting the data to a text representation, then use traditional SQL data loading statements. 9 6. Other Criteria Spatial Database Product Compatibility with GIS applications Server Capability Stand-alone or part of DB system? IBM DB2 spatial extender Supports visualization tools such as ESRI's ArcView GIS, ArcExplorer, ArcInfo, ArcView BusinessAnalyst as well as other vendors such as MapInfo. To view graphic or map representation, a visualization tool must be used. If deployed within DB2 edition with server capabilities then it can. IBM recommends an architecture utilitizing ESRI’s ArcSDE for distributed computing. DB2 Spatial Extender resides in IBM’s DB2 Universal Database Since ArcSDE if a part of ESRI GIS software fimaly, it supports all ESRI GIS software. At the same time, it support AutoCAD by Autodesk. Serves spatial data to ArcGIS Desktop (ArcReader, ArcView, ArcEditor, and ArcInfo), to Internet clients through ArcIMS, and to applications developed with ArcGIS Engine and ArcGIS Server. No, ArcSDE is only a gateway connected RDBMS to Client or GIS application Oracle Spatial is an option for Oracle Enterprise Edition that provides advanced spatial features to support high-end GIS and LBS solutions. Integration with Oracle9i Application Server Oracle Spatial is supported on Oracle Enterprise Edition. Available GIS applications that can run PostGIS are uDig (User-friendly Desktop Internet GIS) and MapServer. Both are internet-web applications that can create, acquire, view, and modify spatial data. PostgreSQL, an open source, object-relational database that is used in conjunction with PostGIS acts as the server. It is capable of running on Windows, Linux, and Unix operating systems. PostGIS is a downloadable software that spatially extends PostgreSQL. ArcSDE Oracle Spatial PostgreSQL / PostGIS 10 Summary In order for DFW Stores, Inc. to evaluate retail site selection in-house, we need a spatial database to store/retrieve spatial data and enhance the company’s future. The main feature that we could use the spatial database for is deciding where to build/close down stores on the basis of costs, statistics, proximity of competitors, and potential clientele. Some functions that would be useful for our company are as follows: View extent of sales area (buffer) and determine which customers live inside and outside of this area (geocode) or if the location of the store does not fully support customers in the area (centroid). Determine nearest location from “model customers” via census tract data to nearest store (distance). Ensure that new store sites do not interfere with other stores customers (overlap, contains, etc…). Model non-producing stores with all available spatial data (customers, site Figure 1: Retail selection based on customers location, competitor location, census bureau and proximity to competitors. information, etc…) to determine why they do not produce so that the business model can be enhanced. Criteria used in the selection for the spatial database are the following: Cost Standards met GIS application Spatial data types supported Queries from the database Spatial functions Data loading Compatibility with other GIS applications Server capability Ability to be stand alone or integration with database While there are several databases and options that could have been used for this comparison, only the following spatial databases were reviewed: ArcSDE—spatial data engine from ESRI, the market leader in GIS applications. PostGIS—open source database and downloadable spatial extension IBM DB2 Spatial Extender—major database vendor with own spatial extension Oracle Spatial—database market share leader with own spatial extension 11 PostGIS Despite the fact that PostGIS is absolutely free, it is hard to recommend it. As the saying goes ‘you get what you pay for’, and because of this fear, “in the spatial industry, open source freeware has a barely measurable market share compared with the proprietary products sold by … other geospatial vendors.” [9] Because of the limited market share, there are very few people that would be available for consulting/support in the event it was needed. Also, PostGIS is totally funded by Refractions Research and some “small time” consultant companies/vendors, and it has no major corporate support. There seems to be a high risk with longevity with this product. ArcSDE Built by the leading GIS vendor in the nation ESRI, it (ArcSDE) has little/no functionality by itself. This option requires the purchase of a qualified RDBMS ($30k $40k), ArcSDE ($10k), and then ArcGIS Desktop (another $5k) in order to get the complete functionality of the system. The total is approximately $45,000-$55,000. Granted, if this system were implemented, you would have one of the most capable and desirable Geographic Information Systems, but for our purposes, it is overkill. Oracle Spatial This selection is quite capable of handling the needs of this company. The functions that are built into it are exactly what this company is looking for. Also, it has been the leading database vendor for a long time, and has many followers. There is ample support available and plenty of consultants that would be available for hire if needed. However, the price for a single processor license of the Enterprise Oracle Database is $40k and one for Oracle spatial is $10k, which comes to a combined total of $50,000. If we were willing to buy this, then we should just go with ArcSDE and a non-Oracle Database. IBM DB2 Spatial Extender Very similar to Oracle Spatial, it has all the spatial functionality needed for our company. The IBM DB2 is the second leading vendor for RDBMS, so there are plenty of consultants available if needed. The ability to visually display the data in ArcExplorer (free by download from ESRI’s website) assisted in this decision. All created data can be stored in shape files for distributing data with other companies. Also, since the company will need to purchase a database for the storage of this system, it will be provided for free with the new purchase of the Enterprise Server Edition of the IBM DB2 database. The total cost for this spatial database will be ~$30,000. (This is $20,000 less than the Oracle Spatial and $15,000 less than the ArcSDE systems.) Recommendation The recommendation from this group is to use IBM DB2 Spatial Extender. It has the same functionality of Oracle Spatial, while being $20,000 less. It does not have the functionality of the ArcSDE system, but it is also $15,000 less. And, in the event we ever 12 wanted all of the functionality of ArcSDE, then we could purchase it and update the database at that time. Appendix I: Functions for use with Oracle Spatial Over 400 spatial functions, Oracle Spatial includes functions for length/area calculations, buffer, centroid, convexhull, geometry intersection, union. list the major functions: 1. SQL Statements for Indexing Spatial Data ALTER INDEX ALTER INDEX REBUILD ALTER INDEX RENAME TO CREATE INDEX DROP INDEX 2. SDO_GEOMETRY Object Type Methods GET_DIMS GET_GTYPE GET_LRS_DIM 10 Spatial Operators SDO_FILTER SDO_NN SDO_NN_DISTANCE SDO_RELATE SDO_WITHIN_DISTANCE 3. Geometry Functions SDO_GEOM.RELATE SDO_GEOM.SDO_ARC_DENSIFY SDO_GEOM.SDO_AREA SDO_GEOM.SDO_BUFFER SDO_GEOM.SDO_CENTROID SDO_GEOM.SDO_CONVEXHULL SDO_GEOM.SDO_DIFFERENCE SDO_GEOM.SDO_DISTANCE SDO_GEOM.SDO_INTERSECTION SDO_GEOM.SDO_LENGTH SDO_GEOM.SDO_MAX_MBR_ORDINATE SDO_GEOM.SDO_MBR SDO_GEOM.SDO_MIN_MBR_ORDINATE SDO_GEOM.SDO_POINTONSURFACE SDO_GEOM.SDO_UNION SDO_GEOM.SDO_XOR SDO_GEOM.VALIDATE_GEOMETRY SDO_GEOM.VALIDATE_GEOMETRY_WITH_CO NTEXT SDO_GEOM.VALIDATE_LAYER SDO_GEOM.VALIDATE_LAYER_WITH_CONTE XT SDO_GEOM.WITHIN_DISTANCE 4. Spatial Aggregate Functions SDO_AGGR_CENTROID SDO_AGGR_CONVEXHULL SDO_AGGR_LRS_CONCAT SDO_AGGR_MBR SDO_AGGR_UNION 5. Coordinate System Transformation Functions SDO_CS.TRANSFORM SDO_CS.TRANSFORM_LAYER SDO_CS.VIEWPORT_TRANSFORM 6. Linear Referencing Functions SDO_LRS.CLIP_GEOM_SEGMENT SDO_LRS.CONCATENATE_GEOM_SEGMENTS SDO_LRS.CONNECTED_GEOM_SEGMENTS SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY SDO_LRS.CONVERT_TO_LRS_GEOM SDO_LRS.CONVERT_TO_LRS_LAYER SDO_LRS.CONVERT_TO_STD_DIM_ARRAY SDO_LRS.CONVERT_TO_STD_GEOM SDO_LRS.CONVERT_TO_STD_LAYER SDO_LRS.DEFINE_GEOM_SEGMENT SDO_LRS.DYNAMIC_SEGMENT SDO_LRS.FIND_LRS_DIM_POS SDO_LRS.FIND_MEASURE SDO_LRS.GEOM_SEGMENT_END_MEASURE SDO_LRS.GEOM_SEGMENT_END_PT SDO_LRS.GEOM_SEGMENT_LENGTH SDO_LRS.GEOM_SEGMENT_START_MEASURE SDO_LRS.GEOM_SEGMENT_START_PT SDO_LRS.GET_MEASURE SDO_LRS.IS_GEOM_SEGMENT_DEFINED SDO_LRS.IS_MEASURE_DECREASING SDO_LRS.IS_MEASURE_INCREASING SDO_LRS.LOCATE_PT SDO_LRS.MEASURE_RANGE SDO_LRS.MEASURE_TO_PERCENTAGE SDO_LRS.OFFSET_GEOM_SEGMENT SDO_LRS.PERCENTAGE_TO_MEASURE SDO_LRS.PROJECT_PT 13 SDO_LRS.REDEFINE_GEOM_SEGMENT SDO_LRS.RESET_MEASURE SDO_LRS.REVERSE_GEOMETRY SDO_LRS.REVERSE_MEASURE SDO_LRS.SCALE_GEOM_SEGMENT SDO_LRS.SET_PT_MEASURE SDO_LRS.SPLIT_GEOM_SEGMENT SDO_LRS.TRANSLATE_MEASURE SDO_LRS.VALID_GEOM_SEGMENT SDO_LRS.VALID_LRS_PT SDO_LRS.VALID_MEASURE SDO_LRS.VALIDATE_LRS_GEOMETRY 7. Migration Procedures SDO_MIGRATE.FROM_815_TO_81X SDO_MIGRATE.OGIS_METADATA_FROM SDO_MIGRATE.OGIS_METADATA_TO SDO_MIGRATE.TO_734 SDO_MIGRATE.TO_81X SDO_MIGRATE.TO_CURRENT 8. Tuning Functions and Procedures SDO_TUNE.ANALYZE_RTREE SDO_TUNE.AVERAGE_MBR SDO_TUNE.ESTIMATE_INDEX_PERFORMANCE SDO_TUNE.ESTIMATE_TILING_LEVEL SDO_TUNE.ESTIMATE_TILING_TIME SDO_TUNE.ESTIMATE_TOTAL_NUMTILES SDO_TUNE.EXTENT_OF SDO_TUNE.HISTOGRAM_ANALYSIS SDO_TUNE.MIX_INFO SDO_TUNE.QUALITY_DEGRADATION SDO_TUNE.RTREE_QUALITY 9. Utility Functions SDO_UTIL.EXTRACT SDO_UTIL.GETVERTICES 14 Appendix II: Functions for use with IBM DB2 Spatial Extender 1. Geometry Conversion ST_AsShape ST_WKBToSQL ST_GeomFromWKB ST_GeomCollFromWKB ST_PointFromWKB ST_LineFromWKB ST_PolyFromWKB ST_MPointFromWKB ST_WKTToSQL ST_PointFromText ST_AsGML ST_MLineFromWKB ST_MPolyFromWKB ST_LineFromText ST_PolyFromText ST_MPointFromText ST_MLineFromText ST_MPolyFromText ST_GeomCollFromTxt ST_GeomFromText 2. Geometry Constructor ST_Point ST_LineString ST_Polygon ST_MultiPoint ST_MultiLineString ST_MultiPolygon ST_GeomCollection ST_Geometry 3. Data types Comparison ST_Contains ST_Crosses ST_Disjoint ST_EnvIntersects ST_EqualCoordsys ST_Equals ST_EqualSRS ST_Intersects ST_MBRIntersects ST_Overlaps ST_Relate ST_Touches 4. Functions for information about dimensions ST_Area ST_Dimension ST_Length 5. Measures and Coordinates for Geometry ST_CoordDim ST_IsMeasured ST_IsValid ST_Is3D ST_M ST_MaxM ST_MaxX ST_MaxY ST_MaxZ ST_MinM ST_MinX ST_MinY ST_MinZ ST_X ST_Y ST_Z 6. Information about geometries within a geometry. ST_Centroid ST_EndPoint ST_GeometryN ST_LineStringN ST_MidPoint ST_NumGeometries ST_NumLineStrings ST_NumPoints ST_NumPolygons ST_PointN ST_PolygonN ST_StartPoint 7. Information About Boundaries ST_Boundary ST_Envelope ST_EnvIntersects ST_ExteriorRing ST_InteriorRingN ST_MBR 15 ST_MBRIntersects ST_NumInteriorRing ST_Perimeter References ArcSDE 1. http://www.esri.com/software/arcgis/arcsde/index.html 2. http://www.gisfusion.com/gis/arcsde.cfm 3. http://www.esri.com/library/brochures/pdfs/arcsde-server.pdf IBM DB2 Spatial Extender 4. http://www.esri.com/partners/alliances/ibm/index.html 5. ftp://ftp.software.ibm.com/software/data/spatial/DB2SEss2.pdf 6. ftp://ftp.software.ibm.com/software/data/spatial/db2sb.pdf 7. ftp://ftp.software.ibm.com/software/data/pubs/brochures/spatial.pdf 8. ftp://ftp.software.ibm.com/ps/products/db2/info/vr8/pdf/letter/db2ire80.pdf 9. ftp://ftp.software.ibm.com/software/data/spatial/warehous.pdf 10. ftp://ftp.software.ibm.com/software/data/spatial/esri.pdf 11. http://www.esri.com/partners/alliances/ibm/pdfs/esri_ibm_flyer.pdf 12. http://www.esri.com/news/arcnews/winter0405articles/ibm-spatially.pdf 13. http://www.esri.com/partners/alliances/ibm/pdfs/db2_ibm.pdf 14. http://www.esri.com/partners/alliances/ibm/pdfs/ads_ibm-esri.pdf 15. http://www.esri.com/partners/alliances/ibm/pdfs/ads_arcuser_enhanced.pdf 16. http://www.esri.com/library/whitepapers/pdfs/gis-technology.pdf 17. http://www.esri.com/library/whitepapers/pdfs/idc_enterprise_apps_feb_2005.pdf 18. ftp://ftp.software.ibm.com/software/data/spatial/esri2005/01.pdf 19. http://www.opengeospatial.org/docs/99-049.pdf Oracle Spatial 20. http://www.oracle.com/technology/products/spatial/index.html 21. http://www.oracle.com/technology/documentation/index.html 22. http://www.gis.com/ PostGIS 23. http://postgis.refractions.net 24. http://www.freegis.org/database/viewobj?obj=659 25. http://www.geospatial-online.com/geospatialsolutions/article/articleDetail.jsp?id=19932 26. http://www.paragoncorporation.com/ITConsumerGuide.aspx?ArticleID=1 16