Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't pull map.js from cartagen.org #103

Open
alyxb opened this issue Feb 6, 2012 · 3 comments
Open

Can't pull map.js from cartagen.org #103

alyxb opened this issue Feb 6, 2012 · 3 comments

Comments

@alyxb
Copy link

alyxb commented Feb 6, 2012

Tried to select a sample of map data by using the rectangle selector,
but the link:

http://cartagen.org/api/0.6/map.json?bbox=-74.0202751,40.66994310380285,-73.9975151,40.68397343931536

seems to be 404'd. So, without installing a Cartagen server, how can I
obtain the JSON for that area?

@jywarren
Copy link
Owner

jywarren commented Feb 6, 2012

As of the forking of MapKnitter from Cartagen, I no longer operate a full planet server at http://cartagen.org. I'm really sorry but it was too much effort on my end; the planet is over 700gb and it takes a lot of CPU and bandwidth to do it.

This means your options are:

  • install your own planet server
  • convince the OSM devs to pull in some of my modifications to the OSM rails port (https://github.com/jywarren/openstreetmap-website), which probably means writing some tests for them
  • write a GeoJSON or GeoRSS parser (based on the NEWSFLOW code) so we can end-run around this limitation
  • hit the OSM API for XML data and convert it following these suggestions:
    • https://github.com/hay/xml2json - python based
    • someone could write a web-based XML->JSON parser and run it as a service so you can download OSM-XML and convert it online

@movermeyer
Copy link

I personally used: http://jsontoxml.utilities-online.info/
It worked fine, except the keys were prefixed with '-' characters.

A quick find/replace worked like a charm.

@Wouter1
Copy link

Wouter1 commented Jun 5, 2020

I'll report here what I did, maybe useful for others trying to get this working

I got it pretty close to working but not completely

  • Download the project code from github (clone) and unzip.

  • Drop the index.html into safari. You will notice that it does not work. That is because of cross-origin restriction.

  • Go to safari develop menu and select "Disable cross-origin restrictions". Now the default map (of rome) should if you refresh the page.

  • Download a map from https://download.geofabrik.de/europe.html
    I took the Isle of Man map as it is small. Take the .osm.bz2 so that you can easily extract the plain .osm map

  • Go to http://www.utilities-online.info/xmltojson/#.Xtos0lDLcTs and copy the xml data in. Wait a few minutes. Copy the json data out and put it in a file

  • Edit the file in a text editor and replace all "- with " (remove all minuses after quotes). As movermeyer indicated, there seems no reason to have these minuses there

  • Copy the file into samples/data

  • Determine the map middle : open the json file or xml file. You will see at the top the map bounds minlat="53.73236" minlon="-5.434554" maxlat="54.6706" maxlon="-3.688718/>. Take some point inside this bounds. In this case, lat=54, lng=-4 would work

  • Edit index.html and put a ref to the json file in in the section "Carthagen.setup". You can comment out/disable the rome stuff. Also change the "lat" and "lng" position to somewhere in the middle of your map.

  • Reload the map

  • I got some vectors at this point, but I also get some error messages in the console and the map stays mostly empty.

The console error is:

cartagen.js : 624 : TypeError: undefined is not an object (evaluating 'this.coastline_nodes.first()[0]')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants