# GDAL/OGR documentation problem (S-57)

**URL:** <https://discourse.julialang.org/t/gdal-ogr-documentation-problem-s-57/80551>\
**Category:** General Usage\
**Created:** [May 5, 2022, 4:55pm UTC](https://discourse.julialang.org/t/gdal-ogr-documentation-problem-s-57/80551 "2022-05-05T16:55:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frits45](https://avatars.discourse-cdn.com/v4/letter/f/3be4f8/32.png) [@frits45](https://discourse.julialang.org/u/frits45)\
**Post date:** [May 5, 2022, 4:55pm UTC](https://discourse.julialang.org/t/gdal-ogr-documentation-problem-s-57/80551/1 "2022-05-05T16:55:56Z")

</div>

Hello,

I have a Python-program to analyse data and I am rewriting it in Julia. The Python version needs over 14 hours, Julia will probably end in under 2 hours.

Now my problem. The result needs to be plotted on a maritime map, S-57 format. In Python I wrote a small library for the maps using GDAL/OGR. Julia has a GDAL package, but the documentation is far too limited for me: I cannot get anything done. Even opening a S-57 file fails in Julia.

Can someone point me to documentation that fits my need, or even help me on my way? I attach a bare minimum file in Python that has my most needed elements.

Thank you for any help.

```julia
from osgeo import ogr

def load_objects(infile, name):
    loc=[]
    dataset = ogr.Open( infile )
    try:
        objects=dataset.GetLayerByName( name )
    except:
        return loc
    if objects is not None:
        feat = objects.GetNextFeature()
        while feat is not None:
            geom=feat.GetGeometryRef()
            if geom.GetGeometryType() == ogr.wkbLineString:
                pnt_count = geom.GetPointCount()
                for pnt in range(pnt_count):
                    lat,lon= geom.GetY(pnt), geom.GetX(pnt)
                    loc.append((lat,lon))
    return loc

loc = load_objects(<some S-57 datafile>, "NAVLNE")
print(loc)

```

---

<div class="post-metadata">

**Author:** ![frits45](https://avatars.discourse-cdn.com/v4/letter/f/3be4f8/32.png) [@frits45](https://discourse.julialang.org/u/frits45)\
**Post date:** [May 10, 2022, 12:43pm UTC](https://discourse.julialang.org/t/gdal-ogr-documentation-problem-s-57/80551/2 "2022-05-10T12:43:19Z")

</div>

I made a step forward. GDAL may not work, ArchGDAL works:

> dataset = ArchGDAL.read(infile)  
> objects = ArchGDAL.getlayer(dataset, name)

Now I need to find and extract an array of lat/lon’s.  
So far I could find the methods needed:

> [API Reference · ArchGDAL.jl](https://yeesian.com/ArchGDAL.jl/stable/reference/#API-Feature-Data)

Any suggestions?

---

<div class="post-metadata">

**Author:** ![frits45](https://avatars.discourse-cdn.com/v4/letter/f/3be4f8/32.png) [@frits45](https://discourse.julialang.org/u/frits45)\
**Post date:** [May 12, 2022, 8:54am UTC](https://discourse.julialang.org/t/gdal-ogr-documentation-problem-s-57/80551/3 "2022-05-12T08:54:13Z")

</div>

OK, very few seem to have experience with my problem.  
This is what happens:

> julia\> dataset = ArchGDAL.read(infile)  
> GDAL Dataset (Driver: S57/IHO S-57 (ENC))  
> File(s):  
> /home/ removed .000
> 
> Number of feature layers: 37  
> Layer 0: DSID (wkbNone)  
> Layer 1: BOYCAR (wkbPoint)  
> Layer 2: BOYLAT (wkbPoint)  
> Layer 3: BOYSAW (wkbPoint)  
> Layer 4: BOYSPP (wkbPoint)  
> Remaining layers:  
> CBLSUB, CTNARE, DWRTPT, DEPARE, DEPCNT,  
> EXEZNE, FOGSIG, LIGHTS, MAGVAR, MIPARE,  
> OBSTRN, OFSPLF, PIPSOL, PRCARE, RTPBCN,  
> RDOSTA, RESARE, SEAARE, SBDARE, SOUNDG,  
> TS\_PAD, TOPMAR, TSSBND, TSSCRS, TSSLPT,  
> TSEZNE, WRECKS, M\_COVR, M\_NPUB, M\_NSYS,  
> M\_QUAL, C\_AGGR,
> 
> julia\> name = “DEPCNT”  
> “DEPCNT”
> 
> julia\> objects = ArchGDAL.getlayer(dataset, name)  
> Layer: DEPCNT  
> Geometry 0 (): [wkbUnknown], LINESTRING (3.294656…), …  
> Field 0 (RCID): [OFTInteger], 274, 275, 276, 277, 278, 279, 280, 281, …  
> Field 1 (PRIM): [OFTInteger], 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, …  
> Field 2 (GRUP): [OFTInteger], 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, …  
> Field 3 (OBJL): [OFTInteger], 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, …  
> Field 4 (RVER): [OFTInteger], 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …  
> …  
> Number of Fields: 24
> 
> julia\> feat = ArchGDAL.unsafe\_getfeature(objects, 1)  
> NULL Feature

How do I get to an array of lat/lon’s? (seems to be in Geometry 0) Later on I will need the depth-value too.  
Thank you
