Re: [gdal-dev] Convert KML to Shapefile PyQGIS

2019-03-20 Thread Julierme Pinheiro
Dear Even Rouault,

I got it done. Thank you very much for your reply.

I appreciated your time

Julierme



On Tue, Mar 19, 2019 at 1:09 PM Even Rouault 
wrote:

> Julierme,
>
> the issue here is that your KML file is seen as a multi-layer dataset, with
> one feature per layer, so you can't use the logic you put below. You need
> to
> merge all the layers in a single one.
>
> You can do that with the ogrmerge.py script that comes with GDAL:
> https://www.gdal.org/ogrmerge.html
>
> $ ogrmerge.py -overwrite_ds -single -src_layer_field_name src_layer -o
> out.shp A_Cycle06.kml
>
> With released versions of the script, this will be very slow. I've just
> pushed a fix to speed that up, so grab:
>
> https://raw.githubusercontent.com/OSGeo/gdal/master/gdal/swig/python/scripts/ogrmerge.py
>
> Even
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Convert KML to Shapefile PyQGIS

2019-03-18 Thread Julierme Pinheiro
Dear all,

I have a kml file which is like a zip kml file available in here (
https://www.eorc.jaxa.jp/ALOS-2/obs/map/world_asc/kml/A_Cycle06.kml) which
has several satellite polygon footprint for Alos/Palsar images. I am in
need to convert all these files from KML to SHAPEFILE, saving the SHP files
using the layer ID.

I am trying to use the piece of code bellow (PyQGIS), but I do not know how
to unzip this kml and save the shapefiles using the layer ID information

vlayer = QgsVectorLayer("D:/KML-Images/A_Cycle06.kml", "line", "ogr")

writer = QgsVectorFileWriter.writeAsVectorFormat(vlayer,
"D:/KML-Images/.shp", "utf-8", None, "ESRI Shapefile")

Any help on that will be very appreciated.

Kind regards


Julierme
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Constructing GDAL_WMS XML files for TMS servers

2018-02-22 Thread Julierme Pinheiro
Hi all,

I found this discussion related to my question: http://osgeo-org.1560.x6.
nabble.com/gdal-dev-Constructing-GDAL-WMS-XML-files-for-TMS-servers-
td5033787.html.

I have several sar images in geoserver and I need to create a XML file for
each TMS service in order to load them in Qgis.
For the wmts services I used the folowing gdal function:
gdal_translate "WMTS:http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.
xml,layer=lb" wmts.xml -of WMTS

Now, what about TMS services in geoserver? Is it possible to create the XML
files using gdal_tranlate for a TMS capabilities request as in "
http://localhost:8080/geoserver/gwc/service/tms/1.0.0/;? If so,  how to
that for a specific layer?

Thank you for your time in advance

Kind Regards

Julierme
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Gdal WMTS configuration

2018-02-16 Thread Julierme Pinheiro
Hi all,

I am creating a gdal wmts xml file for the tile layers in geoserver using
the following gdal function:

 gdal_translate ""'WMTS:
http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetCapabilities,layer=
'$gslayer""
/home/julierme/Desktop/amazonia_sar/amapa/IMG/covmingrad/amapa_north/processadas_gs_xml/$
filenamenoextension.xml -of WMTS

This one output file:


  
http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetCapabilities


amazoniasar_amapanorth_covmingrad:CSKS1_20161120205231_CSKS2_20170216205201_3_CovMinGrad_rgb
  EPSG:4326
  application/vnd.ogc.gml/3.1.1
  
-51.55010461807251
3.749183379113674
-51.04091674089432
3.231662549078465
  
  4
  
  true
  204,404
  true


I am seeding the geoserver layers. In order to speed up QGIS rendering
layers, I wonder if I have to insert the GeoWebCache path in the xml file,
as this:
...

/var/lib/tomcat7/webapps/geoserver/data/gwc/geowebcache.xml
 

Does the insertion of GeoWebCache path help QGIS to render layers faster?

I am doing some tests, but I would like a feedback on that.

Thank you for your time in advance

Kind regards

Julierme
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] GeoTIFF NoData

2018-02-05 Thread Julierme Pinheiro
Hi all,

Sorry if my question has been discussed here before. I followed 1
Answer/Option 2 of this post
to
convert  an image (GeoTIFF) external pixels RGB(255,255,255) to NoData.

So, I used the following command line using GDAL_TRANSLATE :

gdal_translate -a_nodata 255 -of GTiff
/home/julierme/Desktop/amazonia_sar/amapa/IMG/covmingrad/CSKS4_20161223204711_CSKS4_20170124204700_3_CovMinGrad_rgb.tif
/home/julierme/Desktop/amazonia_sar/amapa/IMG/covmingrad/CSKS4_20161223204711_CSKS4_20170124204700_3_CovMinGrad_rgb_nodata.tif

The reason I am doing this is because I had a boundary/border
RGB(255,225,225) in the image. So, I converted the entire image
(255,255,255) pixels to NoData. Now, here are my two issues:

1 - Even after setting the InputTransparentColor = FF in Geoserver as
mentioned in the post Option2, the image border is not transparent. The
border, got an ALPHA_BAND=0.0 surrounding the image. Instead of an
ALPHA_BAND, I need a NaN value for the border. So, I need to completely
remove the ALPHA_BAND and set the border to NaN.

2 - What could I do to convert to nodata only the RGB(255,255,255) image
external pixels, without affecting the internal ones?

Thank you for your time in advance.

Julierme
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev