SQL Server Spatial and Silverlight Map. Control. Fig 1 – SQL Server 2. Spatial and Silverlight Map. Control. Microsoft SQL Server 2. Of course anytime Microsoft burps the world listens. It isn’t perhaps as mature as Post. GIS, but it isn’t as expensive as Oracle either. ![]() Since it’s offered in a free Express version I wanted to give it a try, connecting the Silverlight Map. Controller CTP with some data in MS SQL Server 2. Here is the reference for SQL Server 2. Transact- SQLTo start with I needed some test data in . The new Koordinates Beta site has a clean interface to some common vector data sources. I signed up for a free account and pulled down a version of the San Francisco Bay Area bus stops, bikeways, and transit stations in Geographic WGS 8. The development of open source GIS software has—in terms of software history—a long tradition with the appearance of a first system in 1978. Numerous systems are available which cover all sectors of. Microsoft SQL Server est un syst. Il ne fonctionne que sous. So, I've heard about the new geospatial data types in SQL Server 2008 and my company would like to take advantage of them when we migrate; however, I'm relatively new to geodatabases and geospatial data. SQL SERVER – World Shape files Download and Upload to Database – Spatial Database. EPSG: 4. 32. 6) coordinates as . Koordinates has built a very nice data interface and makes use of Amazon AWS to provide their web services. They include choices for format as well as a complete set of EPSG coordinate systems that make sense for the chosen data source. I selected Geographic WGS 8. EPSG: 4. 32. 6) because one area SQL Server is still lacking is EPSG coordinate system support. EPSG: 4. 32. 6 is the one supported coordinate system in the Transact SQL geography and there is no transform function. Fig 2 - Koordinates SF Bay Bus Stop data. Used in over 60 countries, The Art of Service LAB is built on a vast global library of the world's best Information Technology and Business information and is designed to help you find information, fast. ![]() ![]() With data downloaded I can move on to import. Morten Nielson’s Sharp. GIS has some easy to use tools for importing . MS SQL Server 2. 00. Windows Shape. 2Sql. GUI, at least comparing to the Postgre. SQL/Post. GIS shp. However, batch loading might be a bit painful without cmd line and piping capability. SQL Server Spatial Tools. Fig 3 – Shape. 2Sql from sharpgis. Curiously SQL Server offers two data types, the lat,long spatial data type, geography, and the planar spatial data type, geometry. SRIDs can be associated with a record, but currently there is no transform capability. ![]() The official NHibernate community site. Contribute to the NHibernate Wiki. Find reference documentation. Fig 1 – SQL Server 2008 Spatial and Silverlight MapControl. Microsoft SQL Server 2008 introduces some spatial capabilities. Of course anytime Microsoft burps the world listens. It isn’t perhaps as mature as PostGIS, but it. Hopefully this will be addressed in future versions. Looking ahead to some comparisons, I used Shape. SQL to load Bay Area Bus Stops as geometry and then again as geography. In both cases I ended up with a field named “geom”, but as different data types. The new geo data types hold the spatial features. The data load also creates a spatial index on the geom field. Once my data is loaded into MS Sql Server I need to take a look at it. Using geom. STAs. Text() to show WKT, I can look inside my geography field, “geom”, and verify the loading: SELECT TOP 1. Geography data type offers a choice of 4 global projections and affords some minimalistic zoom along with a lat,long grid for verifying the data. But geometry data type ignores projection. The geometry spatial result offers a grid based on the x,y extents of the data selection. I didn’t find a way to show more than one table at at a time in the spatial view. Here is a list of some helpful geometry functions: OGC Methods on Geometry Instance. And here is a list of geography functions: OGC Methods on Geography Instance. It is worth noting that there are differences in the method lists between geometry and geography. Geography OGC Methods Geometry OGC Methods. STArea STArea. STAs. Binary STAs. Binary. STAs. Text STAs. Text. STBuffer STBoundary. STDifference STBuffer. STDimension STCentroid. STDisjoint STContains. STDistance STConvex. Hull. STEndpoint STCrosses. STEquals STDifference. STGeometry. N STDimension. STGeometry. Type STDisjoint. STIntersection STDistance. STIntersects STEndpoint. STIs. Closed STEnvelope. STIs. Empty STEquals. STLength STExterior. Ring. STNum. Geometries STGeometry. N. STNum. Points STGeometry. Type. STPoint. N STInterior. Ring. N. STSrid STIntersection. STStart. Point STIntersects. STSym. Difference STIs. Closed. STUnion STIs. Empty. STIs. Ring. STIs. Simple. STIs. Valid. STLength. STNum. Geometries. STNum. Interior. Ring. STNum. Points. STOverlaps. STPoint. N. STPoint. On. Surface. STRelate. STSrid. STStart. Point. STSym. Difference. STTouches. STUnion. STWithin. STX. STY. Extended Geography Methods Extended Geometry methods. As. Gml As. Gml (geometry Data Type). As. Text. ZM As. Text. ZM (geometry Data Type). Buffer. With. Tolerance Buffer. With. Tolerance (geometry Data Type). Instance. Of Instance. Of (geometry Data Type). Is. Null Filter (geometry Data Type). Lat Is. Null (geometry Data Type). Long M (geometry Data Type). M Make. Valid (geometry Data Type). Num. Ring Reduce (geometry Data Type). Ring. N To. String (geometry Data Type). To. String Z (geometry Data Type). OGC Geography Static Methods OGC Static Geometry methods. STGeom. From. Text STGeom. From. Text (geometry Data Type). STPoint. From. Text STPoint. From. Text (geometry Data Type). STLine. From. Text STLine. From. Text (geometry Data Type). STPoly. From. Text STPoly. From. Text (geometry Data Type). STMPoint. From. Text STMPoint. From. Text (geometry Data Type). STMLine. From. Text STMLine. From. Text (geometry Data Type). STMPoly. From. Text STMPoly. From. Text (geometry Data Type). STGeom. Coll. From. Text STGeom. Coll. From. Text (geometry Data Type). STGeom. From. WKB STGeom. From. WKB (geometry Data Type). STPoint. From. WKB STPoint. From. WKB (geometry Data Type). STLine. From. WKB STLine. From. WKB (geometry Data Type). STPoly. From. WKB STPoly. From. WKB (geometry Data Type). STMPoint. From. WKB STMPoint. From. WKB (geometry Data Type). STMLine. From. WKB STMLine. From. WKB (geometry Data Type). STMPoly. From. WKB STMPoly. From. WKB (geometry Data Type). STGeom. Coll. From. WKB (geometry Data Type). Extended Static Geography Methods Extended Static Geometry Methods. Geom. From. GML Geom. From. GML. Null Null. Parse Parse. Point Point. Here is an article with some background material on geography vs geometry – SQL Server Spatial Data. Now that we have some spatial data loaded it’s time to see about hooking up to the new Silverlight Map. Controller CTP. The basic approach is to access the spatial data table through a service on the Web side. A service reference can then be added to the Silverlight side, where it can be picked up in the C# code behind for the Map. Control xaml page. This is familiar to anyone using Java to feed a Javascript client. The Database queries happen server side using a servlet with jdbc, and the client uses the asynchronous query result callback to build the display view. Continuing with the new Silverlight Map. Control CTP, I took a look at this tutorial: Johannes Kebeck Blog. However, the new geo data types are not supported through Linq designer yet. This means I wasn’t able to make use of Linq OR/M because of the geom fields. I then switched to an ADO. NET Data Service model, which appears to work, as it produces the ado web service and allows me to plug in my Geo. Model. edmx Geo. Entities into the new auto generated Geo. Data. Service. svc like this: Geo. Data. Service : Data. Service< Geo. Entities> Using the service endpoint call“http: //localhost: 5. Geo. Data. Service. Once again I’m thwarted by OR mapping, this time in EF. Examining the auto generated Geo. Model. designer. cs reveals that geom field class is not generated. Perhaps this will be changed in future releases.< ? Apparently Linq is competing internally wtih ADO. NET EF, see Is LINQ to SQL Dead? I gather going forward . NET 4. 0 will be emphasizing Entity Framework, but as far as spatial data types auto generated code isn’t there yet. Back to manual code. I can add a Silverlight- enabled WCF service to my Geo. Test. Web that connects to the database and then pass the results back to Silverlight using a Data Service Reference. From that point I can use the result inside Page. Map. Layer on the map interface with Ellipse shapes representing the transit stops or Map. Polyline for Bikeways. I know there must be a more sophisticated approach to this process, but for simplicity I’ll just pass results back to the Silverlight page via strings. Here is a WCF service. System. Windows. Forms. System. Collections. Generic. using System. Linq. using System. Runtime. Serialization. System. Service. Model. System. Service. Model. Activation. using System. Text. using System. Data. using System. Data. Sql. Client. System. Configuration. Microsoft. Sql. Server. Types. namespace Geo. Test. Web. . I also noticed that using a geometry data type causes an inordinately long query time. In my test with Bus Stops up to 5 sec was required for a query that was only in the sub second range for a geography data type with the same STIntersects query. After looking over the statistics for the two versions, I could see that the geometry version loops through the entire 7. Perhaps I'm missing something but the geometry index doesn't appear to be working! Here is the Page. WCF service result. System. Collections. Generic. using System. Linq. using System. Net. using System. Windows. using System. Windows. Browser. System. Windows. Controls. System. Windows. Documents. System. Windows. Input. System. Windows. Media. System. Windows. Media. Animation. using System. Windows. Shapes. using Microsoft. Virtual. Earth. Map. Control. using System. Service. Model. using Geo. Test. SFBay. Data. Service. Reference. Geo. Test. . The above code snippet ensures that the endpoint address follows you over to the deployment server. Deployment turned out to be the most frustrating part of the process. Now, I have a Silverlight map display with fully event driven geometry similar to SVG. Tool. Tips give automatic rollover info, but it is also possible to add mouse events to completely customize interaction with individual points, polylines, and polygons. I expect that this will result in more interesting event driven map overlays. Free spatial Essays and Papers. Your search returned over 4.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2016
Categories |