I'd like my iPhone app to respond to the device owner with his/her Australian LGA (local government area) name using their lat/long.

I've found this page below with a Shapefile:

http://www.abs.gov.au/AUSSTATS/[email protected]/DetailsPage/1259.0.30.001July%202010?OpenDocument

However, on my Windows server I only have MS-SQL and my programmer's preferred language is c#.

Can anyone possibly help with this?

My programmer is having some issues with this task and I am pasting his email below as someone may spot what the issue could be:

Bad News - SharpMap does not implements features we need (Within, Contains e.t.c.) for polygons our map contains. So, I could not write app logic we planned.

Good News - SharpMap loads SHP file more correct then my previous custom application and therefore there is no errors as I see after loading.

To keep moving forward I have found the next way: I fill each separate region using different color. In our case we have more than 500 regions. So, I shift B part in RGB color from 1 to 255, then G part, and then R part after all. So, I will have map like this one (in server memory, not displayed to user):


but more bigger size to avoid errors. Then I will re-calculate user coordinates to map pixel values and determine which pixel color is in that place. Using color value I will get region name from the list of regions (gotten from DBF file).

So, looks like we still can solve this task. I will continue today. My next steps are: bigger image, re-calc coordinates, determine color.

  • Your programmer describes a clever and effective raster-based way to solve point-in-polygon queries. What kind of help do you need, then?
    – whuber
    Commented Apr 28, 2011 at 14:16
  • Which version of MS-SQL? are you using (2008 is best for geo-spatial queries)
    – Mapperz
    Commented Apr 28, 2011 at 14:23

2 Answers 2


Can't you simply use point in polygon search?

Something like SELECT dbo.Point_In_Polygon etc, etc.

I'd simply load the coordinates of the polygon to one table and then perform a PiP on that table, using your coordinates.

Unless I have missed a point?

Here's http://www.vb-helper.com/howto_net_point_in_polygon.html a page which shows VB.NET code to do the search, but you do need to know the parts of the polygon


This might be a helpful start


you can use the users location and have google maps locate the overlay (your shapefile in ms-sql) and do an intersect with the location point and polygon (shapefile). Extract the attributes and display the LGA.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.