Jump to content

 
Photo

Zipcode Boundaries to geoJSON

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Ironspike

Ironspike

    Newbie

  • Validated Member
  • Pip
  • 8 posts
  • Gender:Male
  • United States

In a previous thread, I was looking for a more localized
mapping solution that would let me display zip code boundaries on a web app.



Much thanks to FRAX for turning me on to OpenLayers.



After several weeks and crash course in the OpenLayers API –
I’ve been able to work wonders with multiple mapping services – even some open
source ones.



Now, I’ve hit a roadblock.



I think the best possible solution for displaying zip code boundaries
on my map – is to use OpenLayers  - call
a geoJSON file (or KML) with the zip code data.



Sounds simple enough.



My issue is getting zip code boundaries into a geoJSON file.
I’ve browsed the internet and only come across places where you have to do
org2org conversions. I’m sure someone has come across this before.



Can someone point me in the right direction?



Thanks,



Leo



#2
François Goulet

François Goulet

    Ultimate Contributor

  • Validated Member
  • PipPipPipPipPipPip
  • 688 posts
  • Gender:Male
  • Location:Mille-Isles, Qc
  • Interests:Cartography, History, Graphic Design and almost everything else...
  • Canada

I think of 2 ways to do this:

 

Use QGIS and just do a Save As as geojson. Simple enough.

 

Install FTools and use ogr2ogr. Open your FTools Shell, browse to your working directory and type: 

 

ogr2ogr -f geoJSON output.geojson source.shp 


#3
Adam Wilbert

Adam Wilbert

    Legendary Contributor

  • Validated Member
  • PipPipPipPipPip
  • 276 posts
  • Gender:Male
  • Location:Bellingham, WA, USA
  • United States

Not sure if you came across this in your searching, but this website (http://ogre.adc4gis.com) will convert a variety of files to GeoJSON for you. Assuming your ZIP code data is less than 15MB.


  • skorasaurus likes this

Adam Wilbert

@awilbert
CartoGaia.com
Lynda.com author of "ArcGIS Essential Training"


#4
skorasaurus

skorasaurus

    Contributor

  • Validated Member
  • PipPip
  • 39 posts
  • Gender:Not Telling
  • Location:Cleveland, OH, United States
  • United States

Not sure what your source is, (I'm guessing shapefile) but pretty much the standard workflow to your problem is what's described above:

use ogr2ogr or if you prefer a GUI, ala ARC , load it up in qgis and shave as geojson.

 

Is there a particular reason you're trying to avoid ogr2ogr ?

 

BTW, Adam, nice find of the ogre, online ogr2ogr ! I didn't know about it til now !



#5
Ironspike

Ironspike

    Newbie

  • Validated Member
  • Pip
  • 8 posts
  • Gender:Male
  • United States

I wasn't avoiding the ogr2ogr - it was just i wasn't experienced enough in this field to understand what to do with it.

 

However, I managed to do alot since then.

 

Here is my progress:

I managed to take a shp file from the census org and covert it into a KML file. I parsed it into a MSSQL server. Now, using OSM and Openlayers - I managed to create an interactive Zip code look up for Texas.

 

Now - I've hit another issue. 

 

It was asked of me - if I could produce a map layer with a grouping of Zip codes. Honestly, I can do that now. I can put in a 10,20,30 zips in a KML file and use openlayers to display that on OSM.

 

However, if it exceeds more that 30 or so - it reallly bogs down. 

 

Does anyone have any suggestions on how to tackle this issue? Is there a way to render this out ahead of time ... i'm a little lost on this issue.

 

Thanks!






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

-->