Marking Out Features Using Virtual Earth

Spatial data presented in text- or binary-based formats can be hard to visualise - it is much more natural to describe places on the earth by pointing them out on a map. In this chapter, I demonstrate a technique that you can use to build your own small web application that uses the Microsoft Virtual Earth service as a 'drawing canvas' - an interface on which you can pinpoint locations, or trace the outlines of features. Using a few lines of JavaScript code, you can then take the shapes drawn on the map and convert them into WKT format, which you can use in SQL Server to define shapes using SRID 4326 with the STGeomFromText() method.
UPDATED 21/04/2009 The script on this page now accounts for projection depending on whether you choose to create an item of geometry or geography data. Tip: If you want to create an item of geometry data, choose 2d mode. If you want to create an item of geography data, try 3d mode. This will demonstrate how geography Linestrings represent the shortest path between two points on a round-earth, while the geometry datatype represents the shortest straight route between two points on a flat map.

1.) Select the type of geometry to create

2.) Click the map to define point(s) of this geometry

(Coordinates of the mouse cursor are displayed in 2d mode only)

3.) Well-Known Text

The WKT representation of the geometry will appear here.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options