Hemant.
Ah yes, generalizing the line sounds good too - if you want to remove
verticies rather than add them. PostGIS uses the DP algorithm which is
good for most purposes but you may also be interested in http://mapshaper.com/test/demo.html
as the site builds a topology around your uploaded shapefile and is
able to employ some advanced simplification and smoothing algorithms.
Dane
--- \o/ ---
Sent from my phone
On Dec 25, 2009, at 1:50 PM, Hemant Bist <[email protected]> wrote:
Hi Dane,
Yes, you are right. I got a response from PostGIS list(I didn't
occur to me that I should ask this in PostGIS list. I had been using
only mapnik python wrappers and shapefiles so far :-) )
What I needed is available as a sql function(ST_Simplyify) in
PostGIS. I just needed to play around with tolerance a little bit..
In case its useful to anyone, I am pasting the relevant links below.
http://postgis.refractions.net/docs/ST_Simplify.html
http://postgis.refractions.net/docs/ST_SimplifyPreserveTopology.html
http://bostongis.org/PrinterFriendly.aspx?
content_name=postgis_simplify
http://old.nabble.com/simplify-a-linestring-to-n-points-
td20632406.html
Cheers,
HB
On Fri, Dec 25, 2009 at 12:23 PM, Dane Springmeyer
<[email protected]> wrote:
Hemant. Interesting problem. I think you are on the right track
looking into ogr and/or PostGIS. I would try this first in PostGIS
using a few SQL scripts.
In general I would try unioning your whole dataset and then re-
splitting the linework at the desired interval. I did something
similar (though a bit more involved) with the help of PostGIS users
a while back:
http://www.mail-archive.com/[email protected]/msg04582.html
Dane
--- \o/ ---
Sent from my phone
On Dec 24, 2009, at 10:33 PM, Hemant Bist <[email protected]>
wrote:
This is not necessarily a Mapnik question. I am hoping someone can
point me to the right tools.
I have got a polyline shapefile where each segment is roughly 1
meter, and each polyline has roughly 200 segments.
I want to "resample" to convert the polyline to have a segment of
roughly 10 meter and only 20 segments.
Are there any tools that can help do that, or I have to write my own
heuristic by reading shapfile and writing back.
I have looked at ogr2ogr and postgis briefly, but I didn't find
anything relevant there.
Happy holidays,
HB
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users