Help rendering image with manifold + mapnik combo

View: New views
4 Messages — Rating Filter:   Alert me  

Help rendering image with manifold + mapnik combo

by wclapham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all - I'm a relative newbie/first time poster looking for a little help.  I've been trying to do something a little unorthodox here in the world of GIS, using a combination of tools (Manifold Enterprise 8.0.12 + postgres 8.3.5/postgis db + mapnik 0.6) to draw a fictional world, and find myself beating my head on the desk when i keep drawing blank maps.

Here's the overview scoop: I have a fictional, geo-located environment stored in a Manifold System .map file.  It was imported from a group of .SHP files which had been exported out of MAPublisher and then expanded upon. I am now trying to export the drawing to a postgres/gis db (mimicking what the OpenStreetMaps project has done for real world data) so that i can connect to and draw maps/maptiles dynamically using Mapnik.

Since this project uses a number of steps outside the 'normal' use of Manifold and/or Mapnik, I'm at a total loss as to what the problem is. I dont know if the breakdown is in Manifold, my Postgres setup, Mapnik (or a combo of all).  I wish there was just a straight forward tutorial to walk thru, but i'm kinda making it up as i go along. Has anyone else out there tried something like this with any relative success? I've read a few great posts here, and in the Manifold community, which has shed more light on a few things, but nothing has completely solved the issue. I am open to any and all suggestions as I've been pounding on this for months now.

Also, is there a way to build mapnik in windows to run in debug mode?  i'm kinda flying blind with no feedback.

--Some quick facts:

 The environment envelope (in LatLong) is 0, 0, 0.375, 0.375 and I've tried exporting to postgres using WGS84/ll as well as projecting it to Mercator (then re-projecting it to the specific SRID in my spatial_ref_sys).

 If i export everything to unprojected local SHP files from manifold, Mapnik will draw everything just fine.

 Also on the mapnik side, i can draw real world OpenStreetMap data from our postgres/gis db just fine, using the standard generate_tiles.py / xml mapfile combo.

 I have been using the same python script / mapfile combo for my fictional data and simply changing the postgis db info to my own, and the render envelope to fit my area. (i've been using the native extent bounds for the given srs)

 After an export to the postgres/gis db, i can view my fictional world data in Safe FME, and QGIS (so it's technically there)...but projections cannot be verified, and mapnik wont draw it.

--

Sorry for the such a long/problem-filled first post, but on the off-chance that anyone out there has had some success with this...i'd love to hear what you came up with.  I know i must be missing something simple...but grrrrrr, i dont know what! ;)

Thanks a ton in advance for any advice!

-will
--
“The opposite of play isn’t work. It’s depression.”
– Brian Sutton-Smith, professor of eduction (emeritus) University of Pennsylvania


_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Help rendering image with manifold + mapnik combo

by wclapham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just wanted to update this post with a workaround i found.

Rather than trying to force Manifold to do the reprojection to srid 900913 on export to postgres, i kept it simple by exporting the unprojected map info to srid 4326 (wgs84).   I then rewrote my mapnik scripts to take advantage of that srs (instead of the 900913 examples from osm).  That did the trick for now and i am happily looking at a rendered map of my 'fake island'

I'll try doing a spatial transformation of the data inside the db later to see if i can get the projected map version to work too.

-will

wclapham wrote:
Hello all - I'm a relative newbie/first time poster looking for a little
help.  I've been trying to do something a little unorthodox here in the
world of GIS, using a combination of tools (Manifold Enterprise 8.0.12 +
postgres 8.3.5/postgis db + mapnik 0.6) to draw a fictional world, and find
myself beating my head on the desk when i keep drawing blank maps.

Here's the overview scoop: I have a *fictional*, geo-located environment
stored in a Manifold System .map file.  It was imported from a group of .SHP
files which had been exported out of MAPublisher and then expanded upon. I
am now trying to export the drawing to a postgres/gis db (mimicking what the
OpenStreetMaps project has done for real world data) so that i can connect
to and draw maps/maptiles dynamically using Mapnik.

Since this project uses a number of steps outside the 'normal' use of
Manifold and/or Mapnik, I'm at a total loss as to what the problem is. I
dont know if the breakdown is in Manifold, my Postgres setup, Mapnik (or a
combo of all).  I wish there was just a straight forward tutorial to walk
thru, but i'm kinda making it up as i go along. Has anyone else out there
tried something like this with any relative success? I've read a few great
posts here, and in the Manifold community, which has shed more light on a
few things, but nothing has completely solved the issue. I am open to any
and all suggestions as I've been pounding on this for months now.

Also, is there a way to build mapnik in windows to run in debug mode?  i'm
kinda flying blind with no feedback.

--Some quick facts:

 The environment envelope (in LatLong) is 0, 0, 0.375, 0.375 and I've tried
exporting to postgres using WGS84/ll as well as projecting it to Mercator
(then re-projecting it to the specific SRID in my spatial_ref_sys).

 If i export everything to unprojected local SHP files from manifold, Mapnik
will draw everything just fine.

 Also on the mapnik side, i can draw real world OpenStreetMap data from our
postgres/gis db just fine, using the standard generate_tiles.py / xml
mapfile combo.

 I have been using the same python script / mapfile combo for my fictional
data and simply changing the postgis db info to my own, and the render
envelope to fit my area. (i've been using the native extent bounds for the
given srs)

 After an export to the postgres/gis db, i can view my fictional world data
in Safe FME, and QGIS (so it's technically *there*)...but projections cannot
be verified, and mapnik wont draw it.

--

Sorry for the such a long/problem-filled first post, but on the off-chance
that anyone out there has had some success with this...i'd love to hear what
you came up with.  I know i must be missing something simple...but grrrrrr,
i dont know what! ;)

Thanks a ton in advance for any advice!
-will
--
“The opposite of play isn’t work. It’s depression.”
– Brian Sutton-Smith, professor of eduction (emeritus) University of
Pennsylvania

_______________________________________________
Mapnik-users mailing list
Mapnik-users@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Help rendering image with manifold + mapnik combo

by Dane Springmeyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi William,

On May 26, 2009, at 2:17 PM, william clapham wrote:

Hello all - I'm a relative newbie/first time poster looking for a little help.  I've been trying to do something a little unorthodox here in the world of GIS, using a combination of tools (Manifold Enterprise 8.0.12 + postgres 8.3.5/postgis db + mapnik 0.6) to draw a fictional world, and find myself beating my head on the desk when i keep drawing blank maps.


Blank maps usually indicate a mis-match in coordinates used for the bounding box or the use of a coordinate system that does not work with the data being used.

Also, is there a way to build mapnik in windows to run in debug mode?  i'm kinda flying blind with no feedback.

No, there is not. You can download nik2img.py however and run that against a Mapnik XML file in verbose mode, which outputs information on your map bounding box and which data layers intersect it. Seeing that the bbox does not match the layer coordinates is often helpful for noticing problems with your usage of coordinate systems.

--Some quick facts:

 The environment envelope (in LatLong) is 0, 0, 0.375, 0.375

How did you come up with that?

and I've tried exporting to postgres using WGS84/ll as well as projecting it to Mercator (then re-projecting it to the specific SRID in my spatial_ref_sys).

 If i export everything to unprojected local SHP files from manifold, Mapnik will draw everything just fine.

 Also on the mapnik side, i can draw real world OpenStreetMap data from our postgres/gis db just fine, using the standard generate_tiles.py / xml mapfile combo.


Okay.

 I have been using the same python script / mapfile combo for my fictional data and simply changing the postgis db info to my own, and the render envelope to fit my area. (i've been using the native extent bounds for the given srs)

 After an export to the postgres/gis db, i can view my fictional world data in Safe FME, and QGIS (so it's technically there)...but projections cannot be verified, and mapnik wont draw it.


Using which projection? If you are using mercator you will need to change your bounding box to fix mercator coordinates. And you'll need to make sure that your data is appropriate for mercator, since that projection does not allow, for example, coordinates on the earths surface greater than 90 degrees north/south.

Dane


_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Help rendering image with manifold + mapnik combo

by wclapham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dane Springmeyer wrote:
Blank maps usually indicate a mis-match in coordinates used for the  
bounding box or the use of a coordinate system that does not work with  
the data being used.
I suspected as much.  I think the problem stems from the exported reprojection of the data out of manifold as I was trying to force a generic mercator projection (in manifold) into the google mercator (srid900913) on the postgres side.  ... I have had complete success since I started using the unprojected latlong export to postgres, and do the reprojection in mapnik.  Now that I know that works, I can try reprojecting the data on the server after export, but havent had time to get around to it yet.

You can download nik2img.py however and run that  
against a Mapnik XML file in verbose mode, which outputs information  
on your map bounding box and which data layers intersect it. Seeing  
that the bbox does not match the layer coordinates is often helpful  
for noticing problems with your usage of coordinate systems.
Excellent.  I will give nik2img a try.  I've also just build mapnik on the mac and am about to delve into that today.   Lots of good stuff to test today.

How did you come up with that? (referring to my environment latlong 0,0,.375.375)
Nothing special there...that's just where our environment was initially built.  We needed a generic fictional island near the equator, and the original designer started at 0,0 and built up and out.

Using which projection? If you are using mercator you will need to  
change your bounding box to fix mercator coordinates.
When I tried using the mercator projection natively from the database, I generated the bounding box coordinates by forwarding them thru provided latlong coordinates in the python script, but obviously something was not quite right in my source data to begin with.

And you'll need to make sure that your data is appropriate for mercator,
since that projection does not allow, for example, coordinates on the earths  
surface greater than 90 degrees north/south.
Since its a small island on the equator, I didnt think that would be an issue.  But, again...something must have gotten mucked up in the reprojection, so I'll try some other methods.

Thanks for your tips.  I'm halfway to my goal and have some good leads to move me closer.

-will