You are not logged in.

#1 2008-07-29 10:11:17

chubaka
Member
Registered: 2008-07-29
Posts: 2

Use SVG export for Openlayer

hello,

I've discovered openlayer recently,
actually i'm working on it to do some drawing stuff.
All my map are on a local server (I use Tilecache).

My goal for now is trying to add an "export" option, just as openstreetmap does, in order to export and save what i see in my browser in SVG.

I would like to know if this is possible ,
and globally what I have to do for this (if I have to make a Mapserver or if it's okay with Tilecache ...).

Anyway, any tips would be very apreciated, I'm really new to mapping stuff, but I'd like to learn more!

I'm not sure if I'm asking the good question here, and apologise if flooding this forum.

And sorry if my english is not that good...

Offline

#2 2008-07-29 11:13:49

Lambertus
Administrator
From: Apeldoorn (NL)
Registered: 2007-03-17
Posts: 3,269
Website

Re: Use SVG export for Openlayer

If you want the export functionality then the best place is to look at the source of the main OSM website.


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

#3 2008-07-29 13:44:44

emj
Member
From: .se (59.3N17.99E) 0735969076
Registered: 2006-06-18
Posts: 949

Re: Use SVG export for Openlayer

The export function is a mismatch of things.

0. http://trac.openstreetmap.org/browser/s … troller.rb
1. The Mapnik library is used directly to render images directly. see the python script
2. osmarender export is probably done by joining images. In a script called MapOf.. that I don't know anything about. But you can use it here: http://tah.openstreetmap.org/MapOf/


I think your english is fine and you aren't flooding the forum at all.. Very nice question, have been thinking of this myself.

Last edited by emj (2008-07-29 13:50:33)

Offline

#4 2008-08-07 09:47:11

chubaka
Member
Registered: 2008-07-29
Posts: 2

Re: Use SVG export for Openlayer

ok, thank you for these infos.
I'm not very use of ruby scripts but i'll try to do my best.

There's just something hard for me to understand.

There is lots of ways to make your maps appear on openlayer, now i'm using the Tilecache projection witch takes .png tiles on my local server and do all the work (the files are keep in directories like "map/1/2/1.png" which means "map/zoom/x/y .png") .

My question is : do i have a possibility to make export work with this projection, or do I have to change my projection and use Mapnik generated images?

Offline

#5 2008-08-09 12:10:52

emj
Member
From: .se (59.3N17.99E) 0735969076
Registered: 2006-06-18
Posts: 949

Re: Use SVG export for Openlayer

By projection you mean e.g.  EPSG:4326 that tells you how what the meter/pixel ratio is, right?

I don't know how tilecache operates but I guess it's downloading tiles from Openstreetmap. In that case you should use the MapOf script (which is PHP).

If you have a copy of database then it 's the same as the main site. The Openstreetmap site use the Mapnik map drawing library to  export what it has in the postgreSQL database it will set a projection like this:

  prj = mapnik.Projection("+proj=merc +a=6378137
      +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 
      +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over");

You can change this to what ever you want and probably use shortcuts/presets like EPSG:4326..

Last edited by emj (2008-08-09 12:12:07)

Offline

Board footer

Powered by FluxBB