Hi Martijn,
If you mean reproducing the different result from these two queries, then sure
postgis=# select count(*) from (select asbinary(way) as way FROM shoreline_a
where way && setSRID('BOX3D(2796623.4876324
82 8414856.658170387,3648235.036730606 8450106.434262134)'::box3d,900913)) as
foo;
count
-------
293
(1 row)
postgis=# select count(*) from (select asbinary(way) as geom from (select way
from shoreline_a) as "coast-poly" where wa
y && setSRID('BOX3D(2760723.371673184 8425528.555575622,2805251.167990494
8470056.351892933)'::box3d,900913)) as foo;
count
-------
238
(1 row)
It should be easy to reproduce these results by others in a well controlled
way. Just import processed_p shapefile into PostGIS with shp2pgsql and then
make those two queries.
I had thought the the latter query should give more results because it brings
the missing islands on the map but actually it returns less rows. It is also
possible that there is some data errors, some error messages from OpenJUMP are
suggesting that both queries are returning polygons with less that 3 vertices.
Interesting is also that indexed shapefiles seem to behave a in a similar way
when it comes to map appearance. I changed the coastline datasource from
PostGIS to processed_p shapefile and my rendered OSM map remained just the same
with missing islands. Next I took just a subset of processed_p with ogr2ogr
(with command ogr2ogr -f "ESRI Shapefile" -spat 2172000 8279000 3513000
11099000 shoreline_f.shp processed_p.shp). I did not create index for the new
shoreline_f.shp, I edited osm.xml to use that as a datastore, and magically I
now have also all the missing islands on the map.
What ever is going on here I suppose the one who created the osm.xml file and
especially the SQL for creating coast-poly PostGIS datastore there has been
aware of some similar problem that I have faced now. But as I told, I can get
the correct result now by using a Finnish subset of coastline polygon shapefile
without index.
Regards,
-Jukka Rahkonen-
-----Alkuperäinen viesti-----
Lähettäjä: Martijn van Oosterhout [mailto:[EMAIL PROTECTED]
Lähetetty: su 2.11.2008 14:29
Vastaanottaja: Rahkonen Jukka
Kopio: Mapnik users mailing-list
Aihe: Re: [Mapnik-users] Nik2img.py coastline issue
Seems unlikely, can you reproduce this in psql?
On Fri, Oct 31, 2008 at 4:34 PM, Rahkonen Jukka
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I noticed earlier that nik2img.py was missing some coastline elements while
> generate_image.py brings them all to the resulting map.
>
> I believe now that I have isolated the reason for different behaviour from
> PostGIS statement logs.
>
> This seems to be how the database will be queried when nik2img.py is used.
> select asbinary(way) as way FROM shoreline_a where way &&
> setSRID('BOX3D(2796623.487632482 8414856.658170387,3648235.036730606
> 8450106.434262134)'::box3d,900913)
>
> Using generate_image.py leads to a bit different query
>
> select asbinary(way) as geom from (select way from shoreline_a) as
> "coast-poly" where way && setSRID('BOX3D(2760723.371673184
> 8425528.555575622,2805251.167990494 8470056.351892933)'::box3d,900913)
>
> I do not quite understand why these queries are giving different results, but
> they really do. I verified that be sending those directly with OpenJUMP GIS
> and indeed, the nik2img query is giving a map that is missing lots of
> islands. Not all islands, though.
>
> -Jukka Rahkonen-
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users
>
--
Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users