geography

Best way to export/import MS Sql 2008 Geography data

£可爱£侵袭症+ 提交于 2019-12-05 02:32:12
(ANSWER) How to export some Geography data from a Microsoft Sql Server 2008. You'll need to use the command line argument BCP to dump the data in it's original (native) format to a binary file. Then on the other server you can bulk insert this binary data back into a table of the same strucutre. here's some code. Export Command Line: bcp "geodata.dbo.GeographyData" out "C:\GeoData.bin" -T -n -S <servername> Notes This uses a Trusted connection use the bcp /? for more help for your export options if u need to be hardcore. Importing the data T-SQL: bulk insert GeographyData from 'C:\GeoData.bin'

Smoothing GPS tracked route-coordinates

筅森魡賤 提交于 2019-12-05 02:31:54
问题 I have some data of coordinates that I recorded. Unfortunatelly they seem to be not realy good. They jump sometimes over the map. So now I´m searching for some flattening or filtering algorithm that would make the route look more realistic. Currently my only filter is to calculate the max possible meters travelled in a second (in bus or car or walking) and compare them with the coordinates, throwing those away, that are just not possible within a timeframe. So if a person can walk up to 2.5

SQL Server 2008 Geography .STBuffer() distance measurement units

旧时模样 提交于 2019-12-05 02:03:17
I'm working with a geographic point using lat/long and need to find other points in our database within a 5 mile radius of that point. However, I can't seem to find out what the "units" are for STBuffer, it doesn't seem to conform to feet, miles, meters, kilometers, etc. The documentation only refers to them as "units", any suggestions? Thanks [...] from geography::STGeomFromText('POINT(x y)', 4326).STBuffer(z).STIntersects(geography::STGeomFromText('POINT(' + CAST(v.Longitude as varchar(max)) + ' ' + CAST(v.Latitude as varchar(max)) + ')', 4326)) = 1 STBuffer is in meters. More info here. To

How can I convert Geometry data into a Geography data in MS SQL Server 2008?

此生再无相见时 提交于 2019-12-04 18:00:16
问题 How can I convert some Geometry data into Geography data in MS SQL Server 2008? 回答1: Yes you can but the geometry datatype is more forgiving than the geography in my experience. So there is some data you might have in geometry that you can't convert. This article from Spatial Ed was very helpful explaining how to fix data problems and also has some sample queries to convert from Geom to Geog. 来源: https://stackoverflow.com/questions/279983/how-can-i-convert-geometry-data-into-a-geography-data

Geography data type vs. Geometry data type in SQL Server

♀尐吖头ヾ 提交于 2019-12-04 15:51:40
Environment: SQL Server 2012 I'm using an online tool, the only one I could find so far, to plot polygons and points on the earth. http://www.birdtheme.org/useful/googletool.html I have two tables. One stores "areas" as polygons and the other table stores points amongst other things irrelevant to my question. For simplicity, I'll just reduce my scenario to sql variables. In the query below, I'm using the geography data type for well known points of interest. I drew a polygon around Robben Island, a point in Robben Island and a point in Alcatraz. DECLARE @robben_island geography = ('POLYGON((18

Determining cardinal (compass) direction between points

核能气质少年 提交于 2019-12-04 14:11:17
Is there a way to know in SQL Server 2008R2 if a point is at the south,east,etc...of another point? For example, I have an origin point(lat1,lng1) and I want to know where point(lat2,lng2) is located from that origin: north, west,etc... I'm trying to construct a wind rose graph and this might be useful to me. In order to calculate the bearing between two coordinates while using the Geography type in SQL Server 2008 R2, you can use this function: CREATE FUNCTION [dbo].[CalculateBearing] ( @pointA as geography ,@pointB as geography ) RETURNS decimal(18,12) AS BEGIN -- Declare the return variable

Sql 2008 query problem - which LatLong's exists in a geography polygon?

核能气质少年 提交于 2019-12-04 09:48:58
i have the following two tables:- GeoShapes GeoShapeId INT IDENTITY Name VARCHAR(100) ShapeFile GEOGRAPHY [ this is a closed Polygon of Lat/Longs ] CrimeLocations CrimeLocationId INT IDENTITY LatLong GEOGRAPHY [ this is a Lat/Long Point ] Now, i have around 10K GeoShape results and around 500CrimeLocations. I'm trying to figure out which GeoShapes all 500 crime lat/long points exist inside of. :( I just don't get it! I was trying to do an STIntersects on a subquery but that didn't work. Any suggestions? cheers! EDIT 1: I cannot use any GEOMETRY functions .. because (as stated above) these are

Calculating shortest path between 2 points on a flat map of the Earth

孤者浪人 提交于 2019-12-04 08:33:59
How do you draw the curve representing the shortest distance between 2 points on a flat map of the Earth? Of course, the line would not be a straight line because the Earth is curved. (For example, the shortest distance between 2 airports is curved.) EDIT: THanks for all the answers guys - sorry I was slow to choose solution :/ Paul Tomblin I get this sort of information from the Aviation Formulary . In this case: Distance between points The great circle distance d between two points with coordinates {lat1,lon1} and {lat2,lon2} is given by: d=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos

Identifying geographical locations in text

我的未来我决定 提交于 2019-12-04 08:00:02
问题 What kind of work has been done to determine whether a specific string pertains to a geographical location? For example: 'troy, ny' 'austin, texas' 'hotels in las vegas, nv' I guess what I'm sort of expecting is a statistical approach that gives a degree of confidence that the first two are locations. The last one would probably require a heuristic which grabs "%s, %s" and then uses the same technique. I'm specifically looking for approaches that don't rely too heavily on the proposition 'in'

How to define 'geography' type using Npgsql and OrmLite (using postgresql, postgis, c#)

隐身守侯 提交于 2019-12-04 04:02:55
How do I define a postgis 'geography' type in my C# class model so that OrmLite can easily pass it through to Postgresql so I can run spatial queries in addition to saving spatial data to the 'geography' column? The best library is NetTopologySuite for this case; you can use like this; protected GisSharpBlog.NetTopologySuite.Geometries.Geometry _geom; public GisSharpBlog.NetTopologySuite.Geometries.Geometry Geom { get { return _geom; } set { _geom = value; } } protected string _geomwkt; public virtual string GeomWKT { get { if (this.Geom != null) return this.Geom.ToText(); else return ""; }