[gdal-dev] Convert kml to Shapefile and conserve polygon's colors with Ogr2Ogr

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Convert kml to Shapefile and conserve polygon's colors with Ogr2Ogr

waelinsat
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Convert kml to Shapefile and conserve polygon's colors with Ogr2Ogr

lhomme.xavier
Hi
There is no graphical representation in the shapefile.







_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert kml to Shapefile and conserve polygon's colors with Ogr2Ogr

chaitanya_ch
In reply to this post by waelinsat
Wael,

There is no support for style information in shapefile format. However, you can store the style info as a regular attribute value. Using OGR's SQL you can extract the style string from the kml data and then store it in the shapefile. Please go through the OGR SQL page[1]. You can get the style from the special field named "OGR_STYLE".

[1]: http://www.gdal.org/ogr/ogr_sql.html

On Mon, Oct 22, 2012 at 2:25 PM, Wael Tarhouni <[hidden email]> wrote:
Hi All,

I'm using Ogr2Ogr to convert kml file to shapefile but the color of the shape output file is unique, i 'm always loosing the colors of my polygons  in the shapefile...

is there any way to solve this problem ?

Best regards;

--
Wael Tarhouni
Élève ingénieur en Réseaux informatiques et Télecommunication à l'INSAT


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert kml to Shapefile and conserve polygon's colors with Ogr2Ogr

Smith, Michael ERDC-CRREL-NH
In reply to this post by waelinsat
Wael,

First, make sure you are using the libkml driver and not the kml driver.
The libkml driver can read the style information. Then you can get that
information in your shapefile by specifically requesting the ogr_style
column.

Try adding

-sql 'select *, ogr_style as style from Layer0'

Mike

--
Michael Smith

US Army Corps
Remote Sensing GIS/Center




From:  Wael Tarhouni <[hidden email]>
Date:  Monday, October 22, 2012 4:55 AM
To:  "[hidden email]" <[hidden email]>
Subject:  [gdal-dev] Convert kml to Shapefile and conserve polygon's
colors with Ogr2Ogr
Resent-From:  Michael Smith <[hidden email]>


Hi All,

I'm using Ogr2Ogr to convert kml file to shapefile but the color of the
shape output file is unique, i 'm always loosing the colors of my polygons
 in the shapefile...

is there any way to solve this problem ?

Best regards;

--
Wael Tarhouni
Élève ingénieur en Réseaux informatiques et Télecommunication à l'INSAT



_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev