Considering the SQL Server 'geography' data type...
I can enter an array of latitude and longitude (btw is that the correct order to do so or should it be longitude latitude?) points into the field as follows:
INSERT INTO SpatialZonePolygons (Coordinates)
VALUES (geography::STGeomFromText('POLYGON((-122.358 47.653 , -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326));
GO
This then appears as:
0xE6100000010405000000DD24068195D34740F4FDD478E9965EC0508D976E12D3474083C0CAA145965EC04E62105839D4474083C0CAA145965EC04E62105839D44740F4FDD478E9965EC0DD24068195D34740F4FDD478E9965EC001000000020000000001000000FFFFFFFF0000000003
How do I select them back into their latitude and longitude formats?
The Earth rotates one full turn (360º of longitude) in one day. It therefore turns one degree of longitude in 1/360th of a day, or every four minutes. To calculate your longitude, you therefore simply need to work out the time difference between noon at your location and noon at the Prime Meridian.
Android: Open Google Maps; it will zoom to your approximate location. Press and hold on the screen to drop a pin marker. Click on the dropped pin; latitude and longitude will be displayed below the map. If you don't have Google Maps, you can install a free GPS app before heading to your site.
You may use something like this(SQL SERVER)
SELECT Coordinates.Lat 'Latitude', Coordinates.Long 'Longitude' FROM SpatialZonePolygons
For more information - How To Get Lat-Long From Geography Data Type
Select convert(varchar(max),Coordinates) as Coordinates from SpatialZonePolygons ;
take a look here for more information - SQL Server Geography Data Type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With