geospatial

Bing Maps Development - Map with Markers

I really like how this site looks: http://www.microsoft.com/web/WebsiteSpark/Catalog.aspx - specifically the GIS part - the map, the green markers, and how the markers on the map our bound to the list below. Would anyone know some resources on how I can get started on developing something like this? This site is appealing and really li...

Flickr API returning a result set with hits but an empty photo array.

I am making a Flickr api call to flickr.photos.search to find all the photos near a certain lat/lon. It works just for the normal case, but I have found that if I add a text search term to the search I sometimes get a strange return result from Flickr: jsonFlickrApi({"photos":{"page":1, "pages":5, "perpage":250, "total":"1153", "photo"...

Need to move SQL Server 2005 Table storing Lat;Lng as varchar to Spatial ?

I have read some articles about using spatial optimized tables. Actually I use stored latitude and longitude as varchar comma-separated (lat;lng). Could you suggest the best way to perform this change and enumerate the advantages. It's really necessary for a large project or only move to SQL Server 2008? thanks. ...

Shorten this code that determines distance between two lat/longs in C#?

public static double Distance(LatLong from, LatLong to) { double lat1 = from.Latitude * (Math.PI / 180.0); double lat2 = to.Latitude * (Math.PI / 180.0); return Math.Acos((Math.Sin(lat1) * Math.Sin(lat2)) + (Math.Cos(lat1) * Math.Cos(lat2) * Math.Cos((Math.PI / 180.0) * (to.Longitude - from.Longitude)...

Need a standalone Java library for performing spatial calculations on lat/lon data

I'm looking for a Java library that is capable of performing spatial calculations on sets of lat/lon data. Here are some of the functions that I'm looking for: Calculate the Great Circle distance between two points Determine if a point lies within a simple closed polygon, where the polygon is defined by an ordered list of points Dete...

MongoDB Bound Queries: How do I convert mile to radian?

Hello, I have a collection of stores with a geospacial index on the location propery. What I am trying to do is given the user's latitude, latitude and a search radius (mi), I want to return the list of stores that are within those parameters. I saw the following example on the MongoDB documentation (http://www.mongodb.org/display/DOC...

Selecting Map Points Inside a Map Poly

I'm trying to find an algorithmic way to select which points fall within a specific arbitrarily shaped area on a Google Map. Basically I want to be able to provide a point and ask a function if that point lies within an arbitrary (but specifically defined) map area. For example, how could I tell if a point was contained within the green...

Is there python code to parse a geoPDF file to get the projection and image data? a geoPDF2KML tool?

I want to organize lots of geoPDF files so they can easily viewed overlayed onto Google Maps and Google Earth. My 1st step, I think, is to convert the geoPDF to a jpg type image which then needs matching lat,long information. Is there python code to parse a geoPDF file to get the projection and image data? A geoPDF2KML tool? ...

MongoDB's geospatial index: how fast is it?

I'm doing a where in box query on a collection of ~40K documents. The query takes ~0.3s and fetching documents takes ~0.6 seconds (there are ~10K documents in the result set). The documents are fairly small (~100 bytes each) and I limit the result to return the lat/lon only. It seems very slow. Is this about right or am I doing somethi...

PostGIS: bounding box of a multipolygon

SELECT id, ST_Box2D(areas) AS bbox FROM mytable; In this example, the table "mytable" contains two columns: "id" is the unique id number of the row and "areas" is a geometry field containing one MULTIPOLYGON per row. This works fine for multipolygons containing only one polygon, but some rows have polygons very spread apart, hence t...

GeoTools - How to do Dead Reckoning and course calculations using GeoTools classes

I'm currently using the GeoTools toolkit to do calculations on marine vessel data, such as calculating the Great Circle distance between two lon/lat points. I have two other requirements that I need to satisfy, but I'm not sure where to look in GeoTools to find classes to do these kind of calculations. REQUIREMENT #1: Calculate a Dead R...

Google Maps Circle Overlay and Vincenty Formula

Hi - I'm using the Circle overlay as part of the V3 of the Google Maps Javascript API (i.e., see below - we have a subsequent call that actually sets radius/etc.) to display goe-spatial locations in our application. var circle = new google.maps.Circle({ fillColor: lCircleColor, strokeWeight: 2 }); We also have a ...

postgres spatial indexing

I can't seem to find much documentation on this. What's the simplest way to create a database/table on postgres supporting a query like this SELECT * FROM table WHERE distance(POINT(0,0), table.location) <= 1000m; Where POINT(0,0) and table.location should be latitude/longitude pair, and 1000m is 1000 meters. And how should I go about i...

Efficiently Search Nearest Geographic Locations

I searched on SO and didn't really find an answer to this but it seems like a common problem. I have several hundred thousand locations in a database, each having the geocode (lat/long). If it matters, they are spread out across the U.S. Now, I have a client app in which I want users to give me their lat/long and a radius (say 5mi, 10mi...

Comparison of geospatial support for mongodb and postgis

I am in the process of creating a consumer facing location based mobile app that will heavily need GIS support. I have narrowed down the databases to Postgres (PostGIS) and mongodb. I was wondering how someone who has experience with both would rate the geospatial support particularly in the area of: Performance Query expressibility ...

MS SQL - Is using geometry data type to find distance significantly faster?

Hi guys, I have a database which contains a lot of geospatial data ... basically information on 10s of thousands of people, with coordinates for each of them. The coordinates are currently stored as two floats for latitude and longitude, and I use a function to determine the distance between the coordinates in that record and a coord...

Proj4 reprojection using R

Hi, I am trying to reproject coordinates from WGS84 to MGA Zone 53, a UTM projection based on the GDA94 datum. I get infinity as my result, which is definitely incorrect. I am using R's proj4 package like so: > library(proj4) > df <- data.frame("x" = c(131.1, 131.102, 131.1106, 133.34), "y" = c(-13.23, -13.243, -13.22, -22.66)) > df ...

SQL Slow Spatial Data

I have two tables one called Point and other called Poly i have around 400 polygons in the Poly table and around 200 thousand points in Point table. what i wanted is to find how many points are there in a certain polygon. The query i am using is: select COUNT(*) from point p inner join Poly pl on pl.GeoDataID = 101 and p.geopoint.STInt...

PostGIS: register a "geometry" column without AddGeometryColumn

The usual way to create a geometry column is AddGeometryColumn, however I have to work with pre-existing columns, so I can't use that function (as far as I know). Thanks to the PostGIS docs, I can already register the column in the "geometry_columns" table, however AddGeometryColumn seems to do more than create a column and add a row in...

How can I calculate the latitude and longitude of each pixel of an image in a kml file using Python?

I am using .kml file which points to an overlay image (presumably in UTM projection?). The KML file provides the latitudes and longitudes of the bounding box using the "LatLonBox" tag. I need to calculate the latitudes and longitudes of each pixel in this image. Are there any pre-existing libraries in Python that would do this for m...