Ciao a tutti,Stavo preparando una nuova installazione server per un progetto legato al turismo.Agli utenti dopo aver selezionato un percorso, gli viene data la possibilità di esportare la geometria in due formati a scelta (KML e GPX).Ma ho riscontrato alcuni problemi a far funzionare il plug-in "ogr2ogr output format".--
Lanciando il comando ogr2ogr da terminale il risultato è quello desiderato.ogr2ogr -f GPX -a_srs EPSG:4326 -nlt LINESTRING -dsco GPX_USE_EXTENSIONS=YES out.gpx in.gml
Mentre la richiesta WFS non funziona:http://192.168.56.101:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=sitinet:map_tra_eng&outputFormat=GPX&FEATUREID=map_tra_eng.1
Std err:org.geoserver.platform.ServiceException: Exception occurred during output generationat org.geoserver.wfs.response.Ogr2OgrOutputFormat.write(Ogr2OgrOutputFormat.java:274)at org.geoserver.wfs.WFSGetFeatureOutputFormat.write(WFSGetFeatureOutputFormat.java:190)(...)Risposta:<?xml version="1.0" encoding="UTF-8"?><ows:ExceptionReport version="1.0.0"xsi:schemaLocation="http://www.opengis.net/ows http://192.168.56.101:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows"><ows:Exception exceptionCode="NoApplicableCode"><ows:ExceptionText>Exception occurred during output generationogr2ogr did not terminate successfully, exit code 1. Was trying to run: [ogr2ogr, -f, GPX, -a_srs, /usr/local/tomcat/temp/ogrtmpin0.010488442767998762/gdal_srs4540716017553286832wkt, -dsco GPX_USE_EXTENSIONS=YES, -skipfailures, -nlt LINESTRING, /usr/local/tomcat/temp/ogrtmpout0.9765302869865903/map_tra_eng.gpx, /usr/local/tomcat/temp/ogrtmpin0.010488442767998762/map_tra_eng.gml]Resulted in:Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update] [-gt n][-select field_list] [-where restricted_where][-progress] [-sql <sql statement>] [-dialect dialect][-preserve_fid] [-fid FID][-spat xmin ymin xmax ymax] [-wrapdateline][-clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent][-clipsrcsql sql_statement] [-clipsrclayer layer][-clipsrcwhere expression][-clipdst [xmin ymin xmax ymax]|WKT|datasource][-clipdstsql sql_statement] [-clipdstlayer layer][-clipdstwhere expression][-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def][-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...][-segmentize max_dist] [-fieldTypeToString All|(type1[,type2]*)]dst_datasource_name src_datasource_name[-lco NAME=VALUE] [-nln name] [-nlt type] [layer [layer ...]]-f format_name: output file format name, possible values are:-f "ESRI Shapefile"-f "MapInfo File"-f "TIGER"-f "S57"-f "DGN"-f "Memory"-f "BNA"-f "CSV"-f "GML"-f "GPX"-f "KML"-f "GeoJSON"-f "Interlis 1"-f "Interlis 2"-f "GMT"-f "SQLite"-f "ODBC"-f "PostgreSQL"-f "MySQL"-f "DXF"-f "Geoconcept"-f "GeoRSS"-f "GPSTrackMaker"-append: Append to existing layer instead of creating new if it exists-overwrite: delete the output layer and recreate it empty-update: Open existing output datasource in update mode-progress: Display progress on terminal. Only works if input layers have the"fast feature count" capability-select field_list: Comma-delimited list of fields from input layer tocopy to the new layer (defaults to all)-where restricted_where: Attribute query (like SQL WHERE)-wrapdateline: split geometries crossing the dateline meridian(long. = +/- 180deg)-sql statement: Execute given SQL statement and save result.-dialect value: select a dialect, usually OGRSQL to avoid native sql.-skipfailures: skip features or layers that fail to convert-gt n: group n features per transaction (default 200)-spat xmin ymin xmax ymax: spatial query extents-segmentize max_dist: maximum distance between 2 nodes.Used to create intermediate points-dsco NAME=VALUE: Dataset creation option (format specific)-lco NAME=VALUE: Layer creation option (format specific)-nln name: Assign an alternate name to the new layer-nlt type: Force a geometry type for new layer. One of NONE, GEOMETRY,POINT, LINESTRING, POLYGON, GEOMETRYCOLLECTION, MULTIPOINT,MULTIPOLYGON, or MULTILINESTRING. Add "25D" for 3D layers.Default is type of source layer.-fieldTypeToString type1,...: Converts fields of specified types tofields of type string in the new layer. Valid types are : Integer,Real, String, Date, Time, DateTime, Binary, IntegerList, RealList,StringList. Special value All will convert all fields to strings.-a_srs srs_def: Assign an output SRS-t_srs srs_def: Reproject/transform to this SRS on output-s_srs srs_def: Override source SRSSrs_def can be a full WKT definition (hard to escape properly),or a well known definition (ie. EPSG:4326) or a file with a WKTdefinition.</ows:ExceptionText></ows:Exception></ows:ExceptionReport>Specifiche dell'installazione:
- Ubuntu Server 12.04
- JRE 1.6.0_45 (Oracle)
- GeoServer 2.3.1
- GDAL 1.7.3 (con apt-get)
- ogr-2.3.1.jar
Configurazione plugin OGR:(però non funziona nemmeno con la configurazione di default, senza xml di configurazione)<OgrConfiguration><ogr2ogrLocation>ogr2ogr</ogr2ogrLocation><gdalData>/usr/share/gdal/1.7/</gdalData><formats><Format><ogrFormat>GPX</ogrFormat><formatName>GPX</formatName><fileExtension>.gpx</fileExtension><!--<option>-a_srs EPSG:4326</option><option>-dsco GPX_USE_EXTENSIONS=YES</option><option>-skipfailures</option><option>-nlt LINESTRING</option>--><singleFile>true</singleFile><mimeType>application/x-gpx+xml</mimeType></Format><Format><ogrFormat>KML</ogrFormat><formatName>OGR-KML</formatName><fileExtension>.kml</fileExtension><singleFile>true</singleFile><mimeType>application/vnd.google-earth.kml</mimeType></Format></formats></OgrConfiguration>Ho la sensazione che mi sfugge qualcosa.. Qualche suggerimento?geo-saluti- Milan
Hai ricevuto questo messaggio perché sei iscritto al gruppo "GeoServer Italia" di Google Gruppi.
Per annullare l'iscrizione a questo gruppo e non ricevere più i suoi messaggi, invia un'email a geoserver-it...@googlegroups.com.
Per postare messaggi in questo gruppo, invia un'email a geoser...@googlegroups.com.
Visita questo gruppo all'indirizzo http://groups.google.com/group/geoserver-ita?hl=it.
Per ulteriori opzioni, visita https://groups.google.com/groups/opt_out.