3

I have been a .NET programmer for 13 years but I have absolutely no GIS experience and I need a starting point.

I have to take some shape files and overlay them on a graphic of a static map. With the overlays I can then show some data for each polygon I have created. I have the data (xml) and the shp files. How can I get the data from the shp files (I assume its lat/long of all the points that make up the area) and then how can lat/long be converted to x,y to be plotted on a web page.

At this point I am not even sure how to open a SHP file and extract the data. Is there a an API can use to help me to do this. I am going to be using .NET Framework 4.5 Visual Studio 2012.

8
  • Welcome to GIS-SE, but I think you're going to need to go into a bit more detail to get the most applicable assistance. What language/api are you planning to write the web-page in/with (some API's have built in methods for handling different source data files). Is this a one time thing (could you manually open the SHP file with desktop software and get what you need) or does the whole thing need to be automated. What GIS server or desktop software, if any, do you have access to (ex: some GIS software has methods for helping with this). A few more details could get you a better answer.
    – John
    Commented Aug 8, 2014 at 14:43
  • To clarify... You're putting a static map (basically a picture) on a website. You are then wanting to put graphics of some sort on top of that image according to the x/y translation of their lat/long information. Then I am assuming you want a mouse-over or click to display the information you have in your XML? If this is the case, I feel like you are severely over-complicating things and not taking advantage of the awesome things you can do with web mapping.
    – Branco
    Commented Aug 8, 2014 at 14:44
  • @John .NET is the language, and I don't even know where to begin knowing what API to use for this. My preference is to build a solution where the user can point to the SHP file and have it plot certain points on a map. Basically they are areas. Imagine a map with geographic sales areas. Commented Aug 8, 2014 at 14:51
  • @Branco I am probably "severely over complicating things". So please guide me in the direction of how to use this SHP file (I haven't even found a way to open it yet) to take advantage of the "awesome things" I can do with web mapping. Are you suggesting a Google Maps API possibly? I thought about that but I would prefer to have cleaner maps without so much detail as well as you know how awesome google is with privacy ;) Commented Aug 8, 2014 at 14:53
  • 1
    Well, you can always download a free GIS software system like qGIS (www.qgis.org/) to open up and look at the GIS data. You can then check out things like the lat/long or x/y information about the shapefile. Hopefully it has a .prj file with it or what is another pain to figure out GCS or projection. For awesome web mapping things. You can check out ESRI's JavaScript API (developers.arcgis.com/javascript) or OpenLayers (openlayers.org), which let you put the information on to an interactive website. Of course you'd need to publish it online first.
    – Branco
    Commented Aug 8, 2014 at 14:56

1 Answer 1

4

I would recommend displaying your data using SVG (xml based vector image format). There are tools available to convert shapefiles directly to SVG format, which you can then embed directly on your webpage with html. The SVG file will contain coordinates of your shapefile data in a simple xml format.

A useful tool for this is shp2svg.

https://github.com/gka/shp2svg

How to embed SVG into an HTML webpage:

http://www.w3schools.com/svg/svg_inhtml.asp

What's so great about SVG is its simplicity and familiar format. Plus it's very easy to manipulate with javascript or CSS, to apply nice animations or styling. Take a look at some cool SVG map examples, these should get you interested!

http://www.amcharts.com/svg-maps/

5
  • That is pretty neat. Didn't know something like existed.
    – Branco
    Commented Aug 8, 2014 at 15:14
  • Wow! That is great... looking into that now. Commented Aug 8, 2014 at 15:25
  • 1
    Virtual + 1. My rep is 2 points away from being able to upvote :(. As soon as I get high enough Ill comeback and upvote. Commented Aug 8, 2014 at 20:42
  • on the Github its saying that its deprecated are their any other ones you recommend. Commented Aug 13, 2014 at 15:11
  • 1
    @logixologist - Try this online mapping tool for converting shapefiles to SVG. You can also specify projections etc... pretty neat! indiemapper.com/app
    – pvdev
    Commented Aug 13, 2014 at 15:44

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.