Hi!

I'm working for a project that aims to measure IUU (illegal, unregulated
and unregistered) fishing (globalfishingwatch.org). For this I'd like to
be able to classify vessel track points as withing various areas, e.g.
MPAs, economic zones and national waters, of which OSM contains the last
one.

I'm trying to extract this dataset and import it into a PostGIS instance
for further processing. According to
http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dmaritime#Territorial_sea_.2812.C2.A0nm_zone.29
the borders should have these attributes

    boundary=administrative since so many had a problem with grouping it
    together with maritime borders
    maritime=yes to state that this is a maritime border, so it can be
    rendered correctly/different from land borders
    admin_level=2 since it is a national boundary
    border_type=territorial to distinguish it from borders on land

I tried extracting these borders using

    osmosis/bin/osmosis -v \
      --read-pbf-fast file=planet-latest.osm.pbf \
      --tf reject-relations \
      --tf reject-nodes \
      --tf accept-ways boundary=administrative maritime=yes
    admin_level=2 border_type=territorial \
      --write-xml file=12M.osm

I then imported this into PostGIS using

    osmosis/bin/osmosis -v --read-xml file=12M.osm.bz2
    --write-pgsimp-dump directory=12M

and the SQL script osmosis/script/pgsimple_load_0.6.sql.

Now to the problem:

  * I see a bunch of nodes all over the place, some even inland:
    http://cdb.io/1QjDRGN
  * I see only 40 ways with nodes, all somewhere on the border of Iran:
    http://cdb.io/1QjE2Sq


I tried the following query to find the number of ways with nodes:

    select count(*) from (select ways.id, st_makeline(nodes.geom) line
    from ways, way_nodes wn,nodes where wn.way_id = ways.id and
    wn.node_id = nodes.id group by ways.id) a where line is not null;

Thanks in advance,
Egil

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
talk mailing list
talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk

Reply via email to