Basemap to KML polygon

Looks like I've done a mistake with my last post, sorry Eli...
I know how to save datas to a shapefile with the OGR library but only for points datas.
I'll appreciate if somebody can point me how to save a filled contour map basemap into a polygon shapefile, can't find any example with google.
Thanks

···

--
Lionel Roubeyrie - lroubeyrie@...1068...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr

Lionel Roubeyrie wrote:

Looks like I've done a mistake with my last post, sorry Eli...
I know how to save datas to a shapefile with the OGR library but only for points datas.
I'll appreciate if somebody can point me how to save a filled contour map basemap into a polygon shapefile, can't find any example with google.
Thanks

Lionel: I've never done that, and don't know anyone who has. Would be a valuable contribution though.

-Jeff

Looks like I've done a mistake with my last post, sorry Eli...
I know how to save datas to a shapefile with the OGR library but only for points datas.

I'll appreciate if somebody can point me how to save a filled contour map basemap into a polygon shapefile, can't find any example with google.

What do you really want to save here?
A basemap with a contour surface overlayed can be viewed as a assembly of various layers. So this is like the result of the gis operations when you launch the map composer to finish your map.

If you want to create a raster file from the contour part plotted over a basemap I think the python bindings of gdal will get you started.
http://pypi.python.org/pypi/GDAL/
I succeded into writing a tiff file from a gdal array.

I don't know how to write a vector file from python with ogr or shapely. But these questions are better to be asked on the gdal list.:

So about interpolating to a contour look at shapely. Writing should be accomplished with ogr.

That said, I only have testing "experience" with writing geodata with python.

The overkill may be to invoke the respective GRASS command by a script.

I would appreciate if you would tell us what you use by the end.

Kind regards,
Timmie

When it comes to python and GIS the first stop seems to be:

* http://gispython.org/
* http://lists.gispython.org/mailman/listinfo/community

Some more links:
* http://de.giswiki.net/wiki/Kategorie:Python
* http://de.giswiki.net/wiki/WorldMill
* http://zcologia.com/news/750/keytree/
* http://sgillies.net/

Hi Tim,
like I said, I want to "convert" a filled contours map generated with Basemap (example here : http://imagebin.ca/view/3nYnN3.html)
to a polygon shapefile (vector). The filled contours are from a regular points grid which can already be saved into a point shapefile (via ogr python bindings)
and I use QGIS to render it. Now I search to get the filled result into a shp file to pass it through "ogr2ogr -f KML" and render it with GoogleEarth.
I know I can do all this process with the QGIS-GRASS interface, but I must limit softwares dependencies 'cause it'll be placed on a web server, and I think Python it's the best choice for doing that :slight_smile:
After multiple tests, I can retrieve the polygons points coordinates via matplotlib.Patch and save them in a shp file. Now I have troubles with "real" coordinates and meta-datas, but nothing impossible :slight_smile:

Tim Michelsen a écrit :

···

Looks like I've done a mistake with my last post, sorry Eli...
I know how to save datas to a shapefile with the OGR library but only for points datas.
    
I'll appreciate if somebody can point me how to save a filled contour map basemap into a polygon shapefile, can't find any example with google.
    

What do you really want to save here?
A basemap with a contour surface overlayed can be viewed as a assembly of various layers. So this is like the result of the gis operations when you launch the map composer to finish your map.

If you want to create a raster file from the contour part plotted over a basemap I think the python bindings of gdal will get you started.
http://pypi.python.org/pypi/GDAL/
I succeded into writing a tiff file from a gdal array.

I don't know how to write a vector file from python with ogr or shapely. But these questions are better to be asked on the gdal list.:

So about interpolating to a contour look at shapely. Writing should be accomplished with ogr.

That said, I only have testing "experience" with writing geodata with python.

The overkill may be to invoke the respective GRASS command by a script.

I would appreciate if you would tell us what you use by the end.

Kind regards,
Timmie

When it comes to python and GIS the first stop seems to be:

* http://gispython.org/
* http://lists.gispython.org/mailman/listinfo/community

Some more links:
* http://de.giswiki.net/wiki/Kategorie:Python
* http://de.giswiki.net/wiki/WorldMill
* http://zcologia.com/news/750/keytree/
* http://sgillies.net/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Lionel Roubeyrie - lroubeyrie@...1068...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr