[gdal-dev] OGR - S57 - geometry extraction issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[gdal-dev] OGR - S57 - geometry extraction issue

David Ferdoille
Hello all,

We are trying to render S57 files as ENC through Geoserver.

We convert S57 to shapefiles thanks to ogr2ogr : 1 shapefile for 1 class (ex : COALNE) and 1 geometry type (LINE) :  
ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" CELLLL.000 COALNE 
ogr2ogr -skipfailures  -where "OGR_GEOMETRY='POINT' or OGR_GEOMETRY='MULTIPOINT'" SOUNDG_points.shp CELLLL.000 SOUNDG 

We use gdal-2.1.0 with the S57_CSV environnement variable (S57_CSV=/usr/local/share/gdal/ with s57*.csv files).


We noticed that objects (of COALNE class for example) have multiple geometries and each sub-geometry have attributes like POSACC and QUAPOS which are important for S52 representation. 
We've succeeded to extract primitives (Edge, isolated points, connected points, ...), but it looks very complex to operate.


We have some problems to extract geometries from s57 objects :
- we noticed that, for an object, all sub-geometries are aggregated to one geometry
- we didn't succeed to extract geometry attributes like POSACC and QUAPOS


1) Is there a way to not aggregate sub-geometries of an object and get this list of sub-geometries ?
2) Is there a way to extract geometry attributes like POSACC and QUAPOS ?
3) If not, are these features planned ?


Thanks for your help !


David

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

Re: OGR - S57 - geometry extraction issue

Even Rouault-2
David,

As far as I can see from s57objectclasses.csv, POSACC and QUAPOS are not
attributes of the COALNE class, but only from the M_ACCY (Accuracy of data)
and M_QUAL (Quality of data) for POSACC, and M_SREL (Survey reliability) for
QUAPOS.

You might probably retrieve those attributes by identifying features of COALNE
and M_ACCY/M_QUAL/M_SREL that share the same geometry primitives with the
NAME_RCNM and NAME_RCID attributes added with RETURN_LINKAGES=ON. Or perhaps
an easier way would be by layer algebra computation to find which features of
COALNE are inside features of M_ACCY/M_QUAL/M_SREL. Probably with the Identify
method.

See
http://download.osgeo.org/gdal/workshop/foss4ge2015/workshop_gdal.html#__RefHeading__6015_1333016408

By the way, when testing, I identified a regression in 2.1.1 where the open
options of the S57 driver were ignored, that I just fixed per :
https://trac.osgeo.org/gdal/ticket/6609

Even

> Hello all,
>
> We are trying to render S57 files as ENC through Geoserver.
>
> We convert S57 to shapefiles thanks to ogr2ogr : 1 shapefile for 1 class
> (ex : COALNE) and 1 geometry type (LINE) :
> ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo
> "LNAM_REFS=ON" CELLLL.000 COALNE
> ogr2ogr -skipfailures  -where "OGR_GEOMETRY='POINT' or
> OGR_GEOMETRY='MULTIPOINT'" SOUNDG_points.shp CELLLL.000 SOUNDG
>
> We use gdal-2.1.0 with the S57_CSV environnement variable
> (S57_CSV=/usr/local/share/gdal/ with s57*.csv files).
>
>
> We noticed that objects (of COALNE class for example) have multiple
> geometries and each sub-geometry have attributes like POSACC and QUAPOS
> which are important for S52 representation.
> We've succeeded to extract primitives (Edge, isolated points, connected
> points, ...), but it looks very complex to operate.
>
>
> We have some problems to extract geometries from s57 objects :
> - we noticed that, for an object, all sub-geometries are aggregated to one
> geometry
> - we didn't succeed to extract geometry attributes like POSACC and QUAPOS
>
>
> 1) Is there a way to not aggregate sub-geometries of an object and get this
> list of sub-geometries ?
> 2) Is there a way to extract geometry attributes like POSACC and QUAPOS ?
> 3) If not, are these features planned ?
>
>
> Thanks for your help !
>
>
> David

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: OGR - S57 - geometry extraction issue

Ted37
Hi,

I apologize for my english.
POSACC and QUAPOS are specfic attributes (only spatial attributes but we can consider as meta object attributes and not as meta object M_SREL, M_QUAL, M_*).
Objects with POSACC and QUAPOS are points, and mainly SOUNDG, WRECKS, UWTROC, OBSTRN in S57 format.
Currently, I'm testing with HPD Caris and when I want to export datas with POSACC and QUAPOS, it don't works.
BEst regards
Ted


De : Even Rouault <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 27 juillet 2016 19h04
Objet : Re: [gdal-dev] OGR - S57 - geometry extraction issue

David,

As far as I can see from s57objectclasses.csv, POSACC and QUAPOS are not
attributes of the COALNE class, but only from the M_ACCY (Accuracy of data)
and M_QUAL (Quality of data) for POSACC, and M_SREL (Survey reliability) for
QUAPOS.

You might probably retrieve those attributes by identifying features of COALNE
and M_ACCY/M_QUAL/M_SREL that share the same geometry primitives with the
NAME_RCNM and NAME_RCID attributes added with RETURN_LINKAGES=ON. Or perhaps
an easier way would be by layer algebra computation to find which features of
COALNE are inside features of M_ACCY/M_QUAL/M_SREL. Probably with the Identify
method.

See
http://download.osgeo.org/gdal/workshop/foss4ge2015/workshop_gdal.html#__RefHeading__6015_1333016408

By the way, when testing, I identified a regression in 2.1.1 where the open
options of the S57 driver were ignored, that I just fixed per :
https://trac.osgeo.org/gdal/ticket/6609

Even

> Hello all,
>
> We are trying to render S57 files as ENC through Geoserver.
>
> We convert S57 to shapefiles thanks to ogr2ogr : 1 shapefile for 1 class
> (ex : COALNE) and 1 geometry type (LINE) :
> ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo
> "LNAM_REFS=ON" CELLLL.000 COALNE
> ogr2ogr -skipfailures  -where "OGR_GEOMETRY='POINT' or
> OGR_GEOMETRY='MULTIPOINT'" SOUNDG_points.shp CELLLL.000 SOUNDG
>
> We use gdal-2.1.0 with the S57_CSV environnement variable
> (S57_CSV=/usr/local/share/gdal/ with s57*.csv files).
>
>
> We noticed that objects (of COALNE class for example) have multiple
> geometries and each sub-geometry have attributes like POSACC and QUAPOS
> which are important for S52 representation.
> We've succeeded to extract primitives (Edge, isolated points, connected
> points, ...), but it looks very complex to operate.
>
>
> We have some problems to extract geometries from s57 objects :
> - we noticed that, for an object, all sub-geometries are aggregated to one
> geometry
> - we didn't succeed to extract geometry attributes like POSACC and QUAPOS
>
>
> 1) Is there a way to not aggregate sub-geometries of an object and get this
> list of sub-geometries ?
> 2) Is there a way to extract geometry attributes like POSACC and QUAPOS ?
> 3) If not, are these features planned ?
>
>
> Thanks for your help !
>
>
> David

--
Spatialys - Geospatial professional services
http://www.spatialys.com

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



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

Re: OGR - S57 - geometry extraction issue

Ted37
In reply to this post by David Ferdoille
Hi,
Up for my previous answer.
I was wrong for lines and area values POSACC, QUAPOS are on edges and not on "real object".

Regards
Ted



De : David Ferdoille <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 27 juillet 2016 15h12
Objet : [gdal-dev] OGR - S57 - geometry extraction issue

Hello all,

We are trying to render S57 files as ENC through Geoserver.

We convert S57 to shapefiles thanks to ogr2ogr : 1 shapefile for 1 class (ex : COALNE) and 1 geometry type (LINE) :  
ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" CELLLL.000 COALNE 
ogr2ogr -skipfailures  -where "OGR_GEOMETRY='POINT' or OGR_GEOMETRY='MULTIPOINT'" SOUNDG_points.shp CELLLL.000 SOUNDG 

We use gdal-2.1.0 with the S57_CSV environnement variable (S57_CSV=/usr/local/share/gdal/ with s57*.csv files).


We noticed that objects (of COALNE class for example) have multiple geometries and each sub-geometry have attributes like POSACC and QUAPOS which are important for S52 representation. 
We've succeeded to extract primitives (Edge, isolated points, connected points, ...), but it looks very complex to operate.


We have some problems to extract geometries from s57 objects :
- we noticed that, for an object, all sub-geometries are aggregated to one geometry
- we didn't succeed to extract geometry attributes like POSACC and QUAPOS


1) Is there a way to not aggregate sub-geometries of an object and get this list of sub-geometries ?
2) Is there a way to extract geometry attributes like POSACC and QUAPOS ?
3) If not, are these features planned ?


Thanks for your help !


David

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


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

Re: OGR - S57 - geometry extraction issue

David Ferdoille

Hello,


Thanks for the responses,

 

After a long afternoon of tests :

I try to access a WRECKS object, compose by an only point, with a QUAPOS specific value of 5, and an POSACC of 500.0 (find it using CARIS Easy View)

 

1-

In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 WRECKS, I found the object, but no QUAPOS or POSACC (logical because the 2 attributes are not directly linked to the object, but to the geometry).

 

2-

In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 IsolatedNode, I found the node representing the object but also no QUAPOS or POSACC.

 

3-

In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 M_QUAL, I found an only object, spatially containing my wreck object, but POSACC is null.

 

4-

In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 M_QUAL, I found 20 objects, but QUAPOS is null for all of them.

 

5-

No M_ACCY table is present in my dataset.

 

 

According to me, the good way to get these attributes, is the second one (2-), but even if I try a lot of things, I didn’t manage to :

-          Trying all the S57 option with –oo

-          Trying to change the CSV types and attributes catalog used by GDAL

-          Etc…

 

 

Does someone know if it is possible to get these attribute through GDAL/OGR ?

If not, is there another way to get this attributes (python GDAL scripts ? another command line software ?)

 

Thanks again for your help !


Regards


David


2016-07-29 11:31 GMT+02:00 teddy guerin <[hidden email]>:
Hi,
Up for my previous answer.
I was wrong for lines and area values POSACC, QUAPOS are on edges and not on "real object".

Regards
Ted



De : David Ferdoille <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 27 juillet 2016 15h12
Objet : [gdal-dev] OGR - S57 - geometry extraction issue

Hello all,

We are trying to render S57 files as ENC through Geoserver.

We convert S57 to shapefiles thanks to ogr2ogr : 1 shapefile for 1 class (ex : COALNE) and 1 geometry type (LINE) :  
ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" CELLLL.000 COALNE 
ogr2ogr -skipfailures  -where "OGR_GEOMETRY='POINT' or OGR_GEOMETRY='MULTIPOINT'" SOUNDG_points.shp CELLLL.000 SOUNDG 

We use gdal-2.1.0 with the S57_CSV environnement variable (S57_CSV=/usr/local/share/gdal/ with s57*.csv files).


We noticed that objects (of COALNE class for example) have multiple geometries and each sub-geometry have attributes like POSACC and QUAPOS which are important for S52 representation. 
We've succeeded to extract primitives (Edge, isolated points, connected points, ...), but it looks very complex to operate.


We have some problems to extract geometries from s57 objects :
- we noticed that, for an object, all sub-geometries are aggregated to one geometry
- we didn't succeed to extract geometry attributes like POSACC and QUAPOS


1) Is there a way to not aggregate sub-geometries of an object and get this list of sub-geometries ?
2) Is there a way to extract geometry attributes like POSACC and QUAPOS ?
3) If not, are these features planned ?


Thanks for your help !


David

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




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

Re: OGR - S57 - geometry extraction issue

David Ferdoille
Hi,

I'm sorry, I didn't have any time to work on integrating s57 data to geoserver through ogr during several months but I got time to work on it last month.

The main issue : objects may be composed of multiple primitives (isolated node or edge) with geometric attributes like posacc or quapos but ogr makes a aggregation of geometries and ignore those geometric attributes.

We succeed to manage this issue by this process :
1) extract all classes to shapefile with all relations between objects and primitives

ogr2ogr 
-oo "RETURN_PRIMITIVES=ON" 
-oo "RETURN_LINKAGES=ON"
-oo "LNAM_REFS=ON"
-nlt "MULTILINESTRING"
-where "OGR_GEOMETRY='LINESTRING' or  OGR_GEOMETRY='MULTILINESTRING'" 
-fieldTypeToString IntegerList 
cell-class-line.shp 
cell.000 
class


2) extract all primitives to shapefile with a s57-reader modification which return posacc and quapos values

ogr2ogr 
-oo "RETURN_PRIMITIVES=ON" 
-oo "RETURN_LINKAGES=ON" 
-oo "LNAM_REFS=ON" 
-nlt "MULTIPOINT" 
-skipfailures  
cell-isolatednode-point.shp 
cell.000 
IsolatedNode

To get posacc and quapos attributes, the S57Reader::ReadVector function was modified, can I propose the modification to the community on github ?


3) integrate all shapefiles in a PostgreSQL/PostGIS database and work on it to construct all objects-subgeometries with 'name_rcnm' and 'name_rcid' to obtain a database compatible with geoserver.


During my tests, I found some differences between s57attributes.csv, s57objectclasses.csv and the s57 reference (on www.s-57.com for example), I will propose the update on github.


Moreover, I was confronted with the TEMP_BUFFER_SIZE of ogrfeature when converting IntegerList to String because some objects have many subgeometries and the result is truncated (finishing by '...)') and not exploitable. The limit is 80 characters, I tried to increase to 254 (max string length in shp) but it's not enough in some cases : for now, I just log the complete Integerlist in stderr and I handle all errors... I tried the splitlistfield option but it's not very easy to exploit...


Regards


David

Le 07/12/2016 à 22:00, Mike a écrit :
David, did you ever figure this one out? I've run into the same situation, where I need the spatial attributes.

-Mike

On Aug 12, 2016 1:32 AM, "David Ferdoille" <[hidden email]> wrote:

Hello,


Thanks for the responses,

 

After a long afternoon of tests :

I try to access a WRECKS object, compose by an only point, with a QUAPOS specific value of 5, and an POSACC of 500.0 (find it using CARIS Easy View)

 

1-

In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 WRECKS, I found the object, but no QUAPOS or POSACC (logical because the 2 attributes are not directly linked to the object, but to the geometry).

 

2-

In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 IsolatedNode, I found the node representing the object but also no QUAPOS or POSACC.

 

3-

In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 M_QUAL, I found an only object, spatially containing my wreck object, but POSACC is null.

 

4-

In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 M_QUAL, I found 20 objects, but QUAPOS is null for all of them.

 

5-

No M_ACCY table is present in my dataset.

 

 

According to me, the good way to get these attributes, is the second one (2-), but even if I try a lot of things, I didn’t manage to :

-          Trying all the S57 option with –oo

-          Trying to change the CSV types and attributes catalog used by GDAL

-          Etc…

 

 

Does someone know if it is possible to get these attribute through GDAL/OGR ?

If not, is there another way to get this attributes (python GDAL scripts ? another command line software ?)

 

Thanks again for your help !


Regards


David


2016-07-29 11:31 GMT+02:00 teddy guerin <[hidden email]>:
Hi,
Up for my previous answer.
I was wrong for lines and area values POSACC, QUAPOS are on edges and not on "real object".

Regards
Ted



De : David Ferdoille <[hidden email]>
À : [hidden email]
Envoyé le : Mercredi 27 juillet 2016 15h12
Objet : [gdal-dev] OGR - S57 - geometry extraction issue

Hello all,

We are trying to render S57 files as ENC through Geoserver.

We convert S57 to shapefiles thanks to ogr2ogr : 1 shapefile for 1 class (ex : COALNE) and 1 geometry type (LINE) :  
ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" CELLLL.000 COALNE 
ogr2ogr -skipfailures  -where "OGR_GEOMETRY='POINT' or OGR_GEOMETRY='MULTIPOINT'" SOUNDG_points.shp CELLLL.000 SOUNDG 

We use gdal-2.1.0 with the S57_CSV environnement variable (S57_CSV=/usr/local/share/gdal/ with s57*.csv files).


We noticed that objects (of COALNE class for example) have multiple geometries and each sub-geometry have attributes like POSACC and QUAPOS which are important for S52 representation. 
We've succeeded to extract primitives (Edge, isolated points, connected points, ...), but it looks very complex to operate.


We have some problems to extract geometries from s57 objects :
- we noticed that, for an object, all sub-geometries are aggregated to one geometry
- we didn't succeed to extract geometry attributes like POSACC and QUAPOS


1) Is there a way to not aggregate sub-geometries of an object and get this list of sub-geometries ?
2) Is there a way to extract geometry attributes like POSACC and QUAPOS ?
3) If not, are these features planned ?


Thanks for your help !


David

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




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


Garanti sans virus. www.avast.com

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

Re: OGR - S57 - geometry extraction issue

Even Rouault-2

On samedi 4 mars 2017 16:12:03 CET David FERDOILLE wrote:

> Hi,

>

> I'm sorry, I didn't have any time to work on integrating s57 data to

> geoserver through ogr during several months but I got time to work on it

> last month.

>

> The main issue : objects may be composed of multiple primitives

> (isolated node or edge) with geometric attributes like posacc or quapos

> but ogr makes a aggregation of geometries and ignore those geometric

> attributes.

>

> We succeed to manage this issue by this process :

> 1) extract all classes to shapefile with all relations between objects

> and primitives

>

> ogr2ogr

> -oo "RETURN_PRIMITIVES=ON"

> -oo "RETURN_LINKAGES=ON"

> -oo "LNAM_REFS=ON"

> -nlt "MULTILINESTRING"

> -where "OGR_GEOMETRY='LINESTRING' or OGR_GEOMETRY='MULTILINESTRING'"

> -fieldTypeToString IntegerList

> cell-class-line.shp

> cell.000

> class

>

>

> 2) extract all primitives to shapefile with a s57-reader modification

> which return posacc and quapos values

>

> ogr2ogr

> -oo "RETURN_PRIMITIVES=ON"

> -oo "RETURN_LINKAGES=ON"

> -oo "LNAM_REFS=ON"

> -nlt "MULTIPOINT"

> -skipfailures

> cell-isolatednode-point.shp

> cell.000

> IsolatedNode

>

> To get posacc and quapos attributes, the S57Reader::ReadVector function

> was modified, can I propose the modification to the community on github ?

 

Yes, please do so.

 

>

>

> 3) integrate all shapefiles in a PostgreSQL/PostGIS database and work on

> it to construct all objects-subgeometries with 'name_rcnm' and

> 'name_rcid' to obtain a database compatible with geoserver.

>

>

> During my tests, I found some differences between s57attributes.csv,

> s57objectclasses.csv and the s57 reference (on www.s-57.com

> <http://www.s-57.com> for example), I will propose the update on github.

 

Thanks. Note that in trunk I've a few weeks ago merged the _aml and _iw files into the main one.

 

>

>

> Moreover, I was confronted with the TEMP_BUFFER_SIZE of ogrfeature when

> converting IntegerList to String because some objects have many

> subgeometries and the result is truncated (finishing by '...)') and not

> exploitable. The limit is 80 characters, I tried to increase to 254 (max

> string length in shp) but it's not enough in some cases : for now, I

> just log the complete Integerlist in stderr and I handle all errors... I

> tried the splitlistfield option but it's not very easy to exploit...

 

There will be no perfect solution if you output to shapefiles. Did you try to SQLite or Spatialite ? IntegerList are properly supported there.

 

>

>

> Regards

>

>

> David

>

> Le 07/12/2016 à 22:00, Mike a écrit :

> > David, did you ever figure this one out? I've run into the same

> > situation, where I need the spatial attributes.

> >

> > -Mike

> >

> > On Aug 12, 2016 1:32 AM, "David Ferdoille" <[hidden email]

> >

> > <mailto:[hidden email]>> wrote:

> > Hello,

> >

> >

> > Thanks for the responses,

> >

> > After a long afternoon of tests :

> >

> > I try to access a WRECKS object, compose by an only point, with a

> > QUAPOS specific value of 5, and an POSACC of 500.0 (find it using

> > CARIS Easy View)

> >

> > 1-

> >

> > In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo

> > "LNAM_REFS=ON" file.000 WRECKS, I found the object, but no QUAPOS

> > or POSACC (logical because the 2 attributes are not directly

> > linked to the object, but to the geometry).

> >

> > 2-

> >

> > In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo

> > "LNAM_REFS=ON" file.000 IsolatedNode, I found the node

> > representing the object but also no QUAPOS or POSACC.

> >

> > 3-

> >

> > In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo

> > "LNAM_REFS=ON" file.000 M_QUAL, I found an only object, spatially

> > containing my wreck object, but POSACC is null.

> >

> > 4-

> >

> > In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo

> > "LNAM_REFS=ON" file.000 M_QUAL, I found 20 objects, but QUAPOS is

> > null for all of them.

> >

> > 5-

> >

> > No M_ACCY table is present in my dataset.

> >

> > According to me, the good way to get these attributes, is the

> > second one (2-), but even if I try a lot of things, I didn’t

> > manage to :

> >

> > -Trying all the S57 option with –oo

> >

> > -Trying to change the CSV types and attributes catalog used by GDAL

> >

> > -Etc…

> >

> > Does someone know if it is possible to get these attribute through

> > GDAL/OGR ?

> >

> > If not, is there another way to get this attributes (python GDAL

> > scripts ? another command line software ?)

> >

> > Thanks again for your help !

> >

> >

> > Regards

> >

> >

> > David

> >

> >

> > 2016-07-29 11:31 GMT+02:00 teddy guerin <[hidden email]

> >

> > <mailto:[hidden email]>>:

> > Hi,

> > Up for my previous answer.

> > I was wrong for lines and area values POSACC, QUAPOS are on

> > edges and not on "real object".

> >

> > Regards

> > Ted

> >

> >

> > ------------------------------------------------------------------

> > ------

> > *De :* David Ferdoille <[hidden email]

> > <mailto:[hidden email]>>

> > *À :* [hidden email] <mailto:[hidden email]>

> > *Envoyé le :* Mercredi 27 juillet 2016 15h12

> > *Objet :* [gdal-dev] OGR - S57 - geometry extraction issue

> >

> > Hello all,

> >

> > We are trying to render S57 files as ENC through Geoserver.

> >

> > We convert S57 to shapefiles thanks to ogr2ogr : 1 shapefile

> > for 1 class (ex : COALNE) and 1 geometry type (LINE) :

> > ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON"

> > -oo "LNAM_REFS=ON" CELLLL.000 COALNE

> > ogr2ogr -skipfailures -where "OGR_GEOMETRY='POINT' or

> > OGR_GEOMETRY='MULTIPOINT'" SOUNDG_points.shp CELLLL.000 SOUNDG

> >

> > We use gdal-2.1.0 with the S57_CSV environnement variable

> > (S57_CSV=/usr/local/share/gdal/ with s57*.csv files).

> >

> >

> > We noticed that objects (of COALNE class for example) have

> > multiple geometries and each sub-geometry have attributes like

> > POSACC and QUAPOS which are important for S52 representation.

> > We've succeeded to extract primitives (Edge, isolated points,

> > connected points, ...), but it looks very complex to operate.

> >

> >

> > We have some problems to extract geometries from s57 objects :

> > - we noticed that, for an object, all sub-geometries are

> > aggregated to one geometry

> > - we didn't succeed to extract geometry attributes like POSACC

> > and QUAPOS

> >

> >

> > 1) Is there a way to not aggregate sub-geometries of an object

> > and get this list of sub-geometries ?

> > 2) Is there a way to extract geometry attributes like POSACC

> > and QUAPOS ?

> > 3) If not, are these features planned ?

> >

> >

> > Thanks for your help !

> >

> >

> > David

> >

> > _______________________________________________

> > gdal-dev mailing list

> > [hidden email] <mailto:[hidden email]>

> > http://lists.osgeo.org/mailman/listinfo/gdal-dev

> > <http://lists.osgeo.org/mailman/listinfo/gdal-dev>

> >

> > _______________________________________________

> > gdal-dev mailing list

> > [hidden email] <mailto:[hidden email]>

> > http://lists.osgeo.org/mailman/listinfo/gdal-dev

> > <http://lists.osgeo.org/mailman/listinfo/gdal-dev>

>

> ---

> L'absence de virus dans ce courrier électronique a été vérifiée par le

> logiciel antivirus Avast. https://www.avast.com/antivirus

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


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

Re: OGR - S57 - geometry extraction issue

s duclos
In reply to this post by David Ferdoille
David,
>Moreover, I was confronted with the TEMP_BUFFER_SIZE of ogrfeature when converting IntegerList to String because some >objects have many subgeometries and the result is truncated (finishing by '...)') and not exploitable. The limit is 80 >characters, I tried to increase to 254 (max string length in shp) but it's not enough in some cases : for now, I just log >the complete Integerlist in stderr and I handle all errors... I tried the splitlistfield option but it's not very easy to >exploit...


Conserning TEMP_BUFFER_SIZE my hack is to realloc() when more room is needed.
But OGR is about WKT/WKB. Here we are talking internal representation. So when I
need this info I just patch OGR.


Attached is my patch (ogrfeature.cpp.diff) to give you an idea.


rgds,

Sylvain.


On Saturday, March 4, 2017 10:12 AM, David FERDOILLE <[hidden email]> wrote:



Hi,

I'm sorry, I didn't have any time to work on integrating s57 data to geoserver through ogr during several months but I got time to work on it last month.

The main issue : objects may be composed of multiple primitives (isolated node or edge) with geometric attributes like posacc or quapos but ogr makes a aggregation of geometries and ignore those geometric attributes.

We succeed to manage this issue by this process :
1) extract all classes to shapefile with all relations between objects and primitives

ogr2ogr
-oo "RETURN_PRIMITIVES=ON"
-oo "RETURN_LINKAGES=ON"
-oo "LNAM_REFS=ON"
-nlt "MULTILINESTRING"
-where "OGR_GEOMETRY='LINESTRING' or  OGR_GEOMETRY='MULTILINESTRING'"
-fieldTypeToString IntegerList
cell-class-line.shp
cell.000
class


2) extract all primitives to shapefile with a s57-reader modification which return posacc and quapos values

ogr2ogr
-oo "RETURN_PRIMITIVES=ON"
-oo "RETURN_LINKAGES=ON"
-oo "LNAM_REFS=ON"
-nlt "MULTIPOINT"
-skipfailures  
cell-isolatednode-point.shp
cell.000
IsolatedNode

To get posacc and quapos attributes, the S57Reader::ReadVector function was modified, can I propose the modification to the community on github ?


3) integrate all shapefiles in a PostgreSQL/PostGIS database and work on it to construct all objects-subgeometries with 'name_rcnm' and 'name_rcid' to obtain a database compatible with geoserver.


During my tests, I found some differences between s57attributes.csv, s57objectclasses.csv and the s57 reference (on www.s-57.com for example), I will propose the update on github.



Moreover, I was confronted with the TEMP_BUFFER_SIZE of ogrfeature when converting IntegerList to String because some objects have many subgeometries and the result is truncated (finishing by '...)') and not exploitable. The limit is 80 characters, I tried to increase to 254 (max string length in shp) but it's not enough in some cases : for now, I just log the complete Integerlist in stderr and I handle all errors... I tried the splitlistfield option but it's not very easy to exploit...


Regards


David


Le 07/12/2016 à 22:00, Mike a écrit :

David, did you ever figure this one out? I've run into the same situation, where I need the spatial attributes.

>
>
>-Mike
>
>
>On Aug 12, 2016 1:32 AM, "David Ferdoille" <[hidden email]> wrote:
>
>Hello,
>>
>>
>>Thanks for the responses,
>>
>>After a long afternoon of tests :
>>I try to access a WRECKS object, compose by an only point, with a QUAPOS specific value of 5, and an POSACC of 500.0 (find it using CARIS Easy View)
>>
>>1-
>>In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 WRECKS, I found the object, but no QUAPOS or POSACC (logical because the 2 attributes are not directly linked to the object, but to the geometry).
>>
>>2-
>>In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 IsolatedNode, I found the node representing the object but also no QUAPOS or POSACC.
>>
>>3-
>>In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 M_QUAL, I found an only object, spatially containing my wreck object, but POSACC is null.
>>
>>4-
>>In ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" file.000 M_QUAL, I found 20 objects, but QUAPOS is null for all of them.
>>
>>5-
>>No M_ACCY table is present in my dataset.
>>
>>
>>According to me, the good way to get these attributes, is the second one (2-), but even if I try a lot of things, I didn’t manage to :
>>-          Trying all the S57 option with –oo
>>-          Trying to change the CSV types and attributes catalog used by GDAL
>>-          Etc…
>>
>>
>>Does someone know if it is possible to get these attribute through GDAL/OGR ?
>>If not, is there another way to get this attributes (python GDAL scripts ? another command line software ?)
>>
>>Thanks again for your help !
>>
>>
>>Regards
>>
>>
>>David
>>
>>
>>2016-07-29 11:31 GMT+02:00 teddy guerin <[hidden email]>:
>>
>>Hi,
>>>Up for my previous answer.
>>>
>>>I was wrong for lines and area values POSACC, QUAPOS are on edges and not on "real object".
>>>
>>>
>>>Regards
>>>Ted
>>>
>>>
>>>
>>>
>>>
>>>________________________________
>>> De : David Ferdoille <[hidden email]>
>>>À : [hidden email]
>>>Envoyé le : Mercredi 27 juillet 2016 15h12
>>>Objet : [gdal-dev] OGR - S57 - geometry extraction issue
>>>
>>>
>>>
>>>Hello all,
>>>
>>>
>>>We are trying to render S57 files as ENC through Geoserver.
>>>
>>>
>>>We convert S57 to shapefiles thanks to ogr2ogr : 1 shapefile for 1 class (ex : COALNE) and 1 geometry type (LINE) :  
>>>ogrinfo -oo "RETURN_PRIMITIVES=ON" -oo "RETURN_LINKAGES=ON" -oo "LNAM_REFS=ON" CELLLL.000 COALNE
>>>ogr2ogr -skipfailures  -where "OGR_GEOMETRY='POINT' or OGR_GEOMETRY='MULTIPOINT'" SOUNDG_points.shp CELLLL.000 SOUNDG
>>>
>>>
>>>We use gdal-2.1.0 with the S57_CSV environnement variable (S57_CSV=/usr/local/share/gdal / with s57*.csv files).
>>>
>>>
>>>
>>>
>>>We noticed that objects (of COALNE class for example) have multiple geometries and each sub-geometry have attributes like POSACC and QUAPOS which are important for S52 representation.
>>>We've succeeded to extract primitives (Edge, isolated points, connected points, ...), but it looks very complex to operate.
>>>
>>>
>>>
>>>
>>>We have some problems to extract geometries from s57 objects :
>>>- we noticed that, for an object, all sub-geometries are aggregated to one geometry
>>>- we didn't succeed to extract geometry attributes like POSACC and QUAPOS
>>>
>>>
>>>
>>>
>>>1) Is there a way to not aggregate sub-geometries of an object and get this list of sub-geometries ?
>>>2) Is there a way to extract geometry attributes like POSACC and QUAPOS ?
>>>3) If not, are these features planned ?
>>>
>>>
>>>
>>>
>>>Thanks for your help !
>>>
>>>
>>>
>>>
>>>David
>>>______________________________ _________________
>>>gdal-dev mailing list
>>>[hidden email]
>>>http://lists.osgeo.org/mailman /listinfo/gdal-dev
>>>
>>>
>>
>>
>>______________________________ _________________
>>gdal-dev mailing list
>>[hidden email]
>>http://lists.osgeo.org/ mailman/listinfo/gdal-dev
>>

Garanti sans virus. www.avast.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

ogrfeature.cpp.diff (3K) Download Attachment
Loading...