- Cumberland County NC has a population of approximately 320,000 and maintains E911 addressing for over 131,000 addresses within the county as well as for Ft. Bragg military base.
- The document compares features of Spatialware and SQL Server 2008 for working with spatial data and discusses challenges faced in converting from Spatialware to SQL Server 2008 such as changes to spatial function syntax and primary keys.
- Implementation examples provided include using stored procedures and triggers to implement business rules on spatial data as well as creating spatial views for mapping and reporting.
2. Cumberland County Overview
• Geographically located in Southeastern North Carolina about 60
miles South of Raleigh
• Home to Ft. Bragg (the largest military base for active personnel in
the US) Ft. Bragg is home to the 82nd Airborne division ,Special
Forces and FORSCOM.
• Census 2010 population of approximately 320,000
• Our agency maintains all E911 Addresses
for Cumberland County. This includes
subdivision reviews and street centerline
maintenance. To date we have 131,000
addresses and 18,000 street segments
• Ft. Bragg has also contracted our agency to
provide 911 addressing for the entire base.
4. Feature Comparison
• Spatialware Features
– Native MapInfo access from numerous releases
– Rich set of spatial functions
– Runs on many versions of Sql Server and does not require a middle tier application
– Ability to store almost any table created in MapInfo Professional. As an example static
labeling can be stored
– Spatialware is mature and used for many mission critical applications
– Generally requires PBBI product lines to interact with spatial data visually
• Sql Server 2008 Features
– True interoperability - more clients support native reading and writing of spatial data allows
multiple GIS clients to read the same database
– Reduces the need for translating data into multiple proprietary formats as more clients support
native spatial file access
5. Feature Comparison
• Sql Server 2008 Features
– Spatial objects are now stored as a data type making audit trails from
complex geometry possible
• Triggers and/or stored procedures can react to edit events store
history to a secondary table
• Spatialware could not handle Polygons and Poly lines, only point
files
– Sql Server 2008 does not have a rich set of functions for transforming
coordinate systems as part of it’s command set
– Currently there are no spatial functions to aggregate geography
– Sql Server Integrated reporting contains some mapping capabilities
(Example Below)
6. Feature Comparison
• Sql Server 2008 Features
– Reporting Services Embedded Mapping
We have not been able to get the embedded mapping
Engine to zoom to the features of interest at runtime
It appears the mapping engine is not designed for
tables that have a large number of objects
As of this release the mapping engine supports
ESRI shape and Sql 2008 spatial objects.
7. Feature Comparison
• Sql Server 2008 Features
Reporting Services
Interface
Reporting services is accessed via a web browser
The creation, editing and subscriptions are accomplished using this method
“VERY” different than utilizing DTS as many of us have done in previous versions of SQL
8. Feature Comparison
• Sql Server 2008 Features
Reporting Services (Sample Report of Address Assignments using spatial join and view)
These fields are
derived by a view
and spatial join
on two tables
9. • Support of older versions of MapInfo Professional and ProViewer
– Native MapInfo tables saved from Sql Server 2008 are stamped as version 10 tables
– This limitation was overcome by a combination of solutions
• Safe software’s FME product - eliminates the version issue as long as newly implemented field types
(namely date time) are not used
• For files that have used a dbf file extension, FME could not readily solve the problems. Solved by
utilizing combination of MapBasic applications and DOS batch files
• Spatial Function syntax changes
– There are some slight modifications to the syntax of some Spatial functions in Sql Server 2008 vs.
Spatialware
• Geometry construction now requires a spatial reference ID as part of the statement if you are going to
perform any other spatial functions from within Sql Server on the object created. Also there is no
comma between the x and y coordinate fields
----- clipped -----
UPDATE SP_TABLE SET sp_geometry=geometry::STPointFromText('POINT('+ cast (SP_TABLE. Xcoord as
varchar(40)) + ' ' + cast (SP_TABLE.ycoord as varchar(40))+')',2264) where SP_GEOMETRY is null
``
Conversion Challenges
SRID required in Sql syntax
No comma between xy coordinate
pairs as was the case in
Spatialware
10. Conversion Challenges
• Primary Keys are changed from sw_member to mi_prinx
• Reseed primary key
– The Spatialware primary key of sw_member was originally used to generate a unique Url for
our scanned plans
– Easyloader regenerated the primary key field resulting in inconsistencies for file naming
– This was overcome by regenerating the primary key from the sw_member field and via Sql
Server management studio and then specifying the seed value as a value greater than the
highest key value in the original table.
• Sql Server 2008 appears to be more stringent with polygon data than
Spatialware
– Slight topology errors that appeared as a mixed object set when opened in MapInfo
Professional
– In most cases these objects were found to have small spikes and overlapping polygons.
Disaggregating the objects and removing the polylines solved this issue
11. Conversion Challenges
• MS Access does not support spatial feature types
– Data entry performed from a MS Access form had to be modified based on a view that did
not contain the spatial field. The default field name for spatial date is sp_geometry
• Spatial views must contain the spatial field and the primary key
– When a map catalog entry has to be created manually
• Use “make DBMS table mappable” function or
• manually create the map catalog entry via Sql Server Enterprise Manager
• Views cannot have spaces in the view name
– View_Name will work where View Name will not
12. Implementation
• Spatial Functions via Stored Procedures and
Triggers
• By implementing various stored procedures and/or triggers local business
rules can be implemented regardless of the GIS client
• Front end applications based on grid or form views can utilize these
procedures making data entry for tabular information more intuitive
• Many end users do not necessarily require a map interface but require the
functionality of spatial queries. These can be performed from various
applications that call spatial functions to return the required information
• Spatial Joins/Views
• Implementing these joins/views on Sql allows flexibility for various clients
and needs
• Table structures for mapping and reporting can generally be modified
instead of a cumbersome export routine
• Sample spatial view that creates an addressing point file for our dispatch software
SELECT a.Adda + ' ' + a.Sta AS 'Address', NULL AS 'Apt', a.Xcoord, a.Ycoord, b.city AS 'City', a.Adda, a.Sta AS 'Street',
a.St_Pre AS 'Direction',
a.St_Name AS 'Plainst', a.St_Suf AS 'Streettype', a.Post_direc AS 'Postdirect', a.MI_PRINX, a.SP_GEOMETRY
FROM dbo.AddressPointFIle AS a CROSS JOIN
dbo.EMG_DISTRICTS_COMBINED AS b
WHERE (b.SP_GEOMETRY.STContains(a.SP_GEOMETRY) = 1)
13. Implementation (Cont.)
Our local parcel number is in
essence a state plane
coordinate rearranged. By
utilizing a trigger we are able
to create coordinate values
and spatial point objects as
data is entered.
Unique file names are
generated for scanned
development plans based
on the primary key field.
Users can interact with
these plans to view
detailed information
related to E911
Addressing and Planning
Information
Development Plan Data Entry
15. Future Applications
– We hope to have future web mapping
applications utilizing backend Sql Server 2008
Spatial Data
– We are investigating the ability to use Sql
Server 2008 compact edition for offline data
collection that includes spatial data types
– A combination of SSIS and stored procedures
will be used for implementing the new PBBI
crime mapping application