geography

Moving a Point along a Path in SQL Server 2008

本秂侑毒 提交于 2019-11-27 22:38:08
问题 I have a geography field stored in my database, holding a linestring path. I want to move a point n meters along this linestring, and return the destination. For example, I want the destination point 500 meters along the linestring starting from its beginning. Here's an example -- what is the YourFunctionHere ? Or, is there another way? DECLARE @g geography; SET @g = geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656, -122.310 47.690)', 4326); SELECT @g.YourFunctionHere

What services can I used to find a user's location based on their IP address?

混江龙づ霸主 提交于 2019-11-27 16:58:23
If you need to locate a user based on their IP address, what services are available (free and not free services are fine)? P.S. I understand that some users use proxies etc., that means the result is not 100% accurate. That's ok. Most geolocation services allow you to download a database full of IP Address to city or country maps. Some also provide web service apis for free (limited number of requests) or a paid subscription. MaxMind has one such service that you can use which is free to determine the user's location. Their minFraud service allows 500 free queries per day. A sample for their

Convert geography to geometry SQL Server 2008R2

本秂侑毒 提交于 2019-11-27 15:21:51
问题 Hello, i have the following code in SQL Server, why if i want to calculate the sTArea of @geog fails and with @geom succeed?, how can i convert this polygon from geometry to geography datatype in order to get the STArea?, thank you. DECLARE @geom geometry; SET @geom = geometry::STGeomFromText('POLYGON ((-99.213546752929688 19.448402404785156, -99.2157974243164 19.449802398681641, -99.2127456665039 19.450002670288086, -99.213546752929688 19.448402404785156))', 4326); select @geom.STArea();

SQL 2008 geography & geometry - which to use?

烈酒焚心 提交于 2019-11-27 13:11:19
问题 I'm creating a Google map mashup and am using SQL 2008. I will have a large number of points on the earth and will want to perform various calculations on them in SQL - such as selecting all points contained within a particular polygone, or select all points within 10km of XY. I have never used and SQL spatial features before. Should I use the geography or the geometry datatype for this? 回答1: Geography is the type that is intended for plotting points on the earth. If you have a table that

Geospatial coordinates and distance in kilometers

旧时模样 提交于 2019-11-27 11:23:44
This is a followup to this question . I seem to be stuck on this. Basically, I need to be able to convert back and forth to referring to coordinates either in the standard degree system OR by measuring a distance north from the south pole along the international date line, and then a distance east starting from that point on the date line. To do this (as well as some more general distance-measuring stuff), I have one method for determining the distance between two lat/lon points, and another method that takes a lat/lon point, a heading and a distance, and returns the lat/lon point at the end

NHibernate.Spatial and Sql 2008 Geography type - How to configure

為{幸葍}努か 提交于 2019-11-27 10:34:26
问题 I am trying to use Nhibernate with the Sql 2008 Geography type and am having difficulty. I am using Fluent Nhibernate to configure which I am fairly new to so that may be the problem as well. First, the class I am trying to persist looks something like: public class LocationLog : FluentNHibernate.Data.Entity { public virtual new int Id {get;set;} public virtual DateTime TimeStamp {get;set;} public virtual GisSharpBlog.NetTopologySuite.Geometries.Point Location {get;set;} } The mapping class

Python: speeding up geographic comparison

雨燕双飞 提交于 2019-11-27 02:45:27
问题 I've written some code that includes a nested loop where the inner loop is executed about 1.5 million times. I have a function in this loop that I'm trying to optimize. I've done some work, and got some results, but I need a little input to check if what I'm doing is sensible. Some background: I have two collections of geographic points (latitude, longitude), one relatively small collection and one relatively huge collection. For every point in the small collection, I need to find the closest

How to find distance from the latitude and longitude of two locations?

本小妞迷上赌 提交于 2019-11-27 00:53:22
I have a set of latitudes and longitudes of locations. How to find distance from one location in the set to another? Is there a formula ? The Haversine formula assumes a spherical earth. However, the shape of the earh is more complex. An oblate spheroid model will give better results. If such accuracy is needed, you should better use Vincenty inverse formula . See http://en.wikipedia.org/wiki/Vincenty's_formulae for details. Using it, you can get a 0.5mm accuracy for the spheroid model. There is no perfect formula , since the real shape of the earth is too complex to be expressed by a formula.

What services can I used to find a user's location based on their IP address?

こ雲淡風輕ζ 提交于 2019-11-26 22:30:26
问题 If you need to locate a user based on their IP address, what services are available (free and not free services are fine)? P.S. I understand that some users use proxies etc., that means the result is not 100% accurate. That's ok. 回答1: Most geolocation services allow you to download a database full of IP Address to city or country maps. Some also provide web service apis for free (limited number of requests) or a paid subscription. MaxMind has one such service that you can use which is free to

Calculate Earth convex hull polygon area given latitude and longitude

家住魔仙堡 提交于 2019-11-26 21:40:43
问题 I have searched for explanations and algorhitms how to calculate Earth's polygon surface area. I've found this and this Lets say I got already convex hull points [56.992666,24.126051], [58.00282,25.930147], [58.787955,25.565078], [59.4997,24.861427], [59.463678,24.711365], [59.395767,24.599837], [56.992666,24.126051] From second link the first answers uses Python library and second answer approach won't give quite precise area even if we assume that Earth is sphere (am I right)? What