Re: Cartagen data

11 views
Skip to first unread message

Jeffrey Warren

unread,
Jun 15, 2011, 11:24:54 AM6/15/11
to Jesper Garneij, cartag...@googlegroups.com
Hi, Jesper -

So Cartagen by default is set up to show OpenStreetMap data, for which the entire US dataset would be many gigabytes, maybe tens of gigabytes. I think it's probably showing the geographic center of the US, at a high zoom level -- like a mile across.

However, this shouldn't be a problem -- you can load whatever data you want into it with the "static_map" setting -- this page shows an example of a set of outlines of all countries in the world:

http://newsflow.cartagen.org (i hope it's still running)

You'll need it in GeoJSON, and you can write a small parser based on the code in that above example. 

Or, you could try to get OSM-style XML data and use the Cartagen server to convert it to JSON; there are a few examples of people doing this on the mailing list already:


But basically you go to:


and it should yield a JSON file. It's a little buggy but give it a try.

The static map parameter is set here:

Cartagen.setup({
stylesheet: "/static/rome/style.gss",
static_map: false,
static_map_layers: ["more.json"],
lat: 41.891,
lng: 12.4902,
// debug: true
})

From the default index.html, you'll have to change "static_map" to true, and add your json file (relative address) where it says "more.json". 

Hope this is helpful and please do post links to your project so we can see them, even if they're early drafts. Without occasionally seeing a project online, i have little incentive to keep answering questions!! ;-)

Jeff


On Wed, Jun 8, 2011 at 4:21 AM, Jesper Garneij <jes...@alterset.com> wrote:
Jeffrey,

I've been tasked with creating a map of the US where the user can select state, and congressional district.  We'd also like to display major cities and bodies of water.  But other than that, no more detail should be necessary.  So I've set up the client edition to start familiarizing myself with the Cartagen application.  But my problem is, I need the data for the US to start with.  When I search for USA, United States of America or anything similar, cartagen.org doesn't produce any results.  I only see a couple of white lines.

I considered that maybe the zoom level is too high by default, but zooming doesn't seem to invoke a re-draw of the map.  Not for any map, if I search for Paris (which loads), I can't seem to zoom in or out.  I use my Apply Mighty Mouse to zoom, plus or minus on my Mac keyboard does nothing.

So what I'm wondering is, how could I get a hold of the data I need?  And is it possible to load/display only the set of data I mentioned, and omit everything else?

Cartagen looks like a fantastic app, good work!

Best,
---
Jesper Garneij  |  Front-End Developer
---------------------------------------------------------
----------
---------------------------------------------------------


Reply all
Reply to author
Forward
0 new messages