Re: [OSM-dev] Truncating geometries

2015-11-09 Thread Malcolm Herring

On 09/11/2015 16:12, Sebastian Kürten wrote:

I recently published a new project called osm4j which can be used to
achieve this.


This looks very interesting, especially as the application I need it for 
is also Java. I will read your documentation carefully!



___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Truncating geometries

2015-11-09 Thread Sebastian Kürten
Hi Malcolm,

I recently published a new project called osm4j which can be used to
achieve this. The wiki [1] already contains pointers to resources about
the project. The tutorial [2] may be helpful as well, espescially the
sections about building geometry [3] and about applying polygon
operations [3].

Basically the library allows you to build JTS objects from ways and
relations (LineString, Polygon and MultiPolygon) and apply the
operations from the Geometry [5] class to do intersections with
arbitrary polygons.

Sebastian

[1] http://wiki.openstreetmap.org/wiki/Osm4j
[2] http://www.topobyte.de/tutorials/osm4j/index.html
[3] http://www.topobyte.de/tutorials/osm4j/building-geometry.html
[4] http://www.topobyte.de/tutorials/osm4j/using-polygon-operations.html
[5] 
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html

On Mon, 9 Nov 2015 09:00:28 +
Malcolm Herring  wrote:

> Are there any tools out there that will properly truncate ways & 
> multipolygons at bounding box boundaries, keeping closed ways & 
> mutipolygons as properly formed areas?
> 
> 
> ___
> dev mailing list
> dev@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev

___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Truncating geometries

2015-11-09 Thread GerdP
Malcolm Herring wrote
> Are there any tools out there that will properly truncate ways & 
> multipolygons at bounding box boundaries, keeping closed ways & 
> mutipolygons as properly formed areas?
> 
> 
> ___
> dev mailing list

> dev@

> https://lists.openstreetmap.org/listinfo/dev

The tile splitter for mkgmap 
http://www.mkgmap.org.uk/doc/splitter.html
is able to extract all data from a planet file which is
relevant for a given bounding box. That means
it can be configured to write all relations and ways
which may touch the bbox or enclose it without
having any point in the bbox itself.
The output is OSM format , but you still need a tool which
truncates each line / area. The code for mkgmap
could be a base for that, but I guess there are other
tools which are not that specialized and therefore 
easier to adapt.

Gerd



--
View this message in context: 
http://gis.19327.n5.nabble.com/Truncating-geometries-tp5859440p5859450.html
Sent from the Developer Discussion mailing list archive at Nabble.com.

___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Truncating geometries

2015-11-09 Thread Frederik Ramm
Hi,

On 11/09/2015 10:00 AM, Malcolm Herring wrote:
> Are there any tools out there that will properly truncate ways & 
> multipolygons at bounding box boundaries, keeping closed ways & 
> mutipolygons as properly formed areas?

Not to my knowledge. You'd have to convert to shape files and then use
ogr2ogr (or similar) to achieve that. Of course nothing keeps you from
running something like shp2osm or polyshp2osm on the resulting shape
file, generating a pseudo-OSM file again...

Bye
Frederik

-- 
Frederik Ramm  ##  eMail frede...@remote.org  ##  N49°00'09" E008°23'33"

___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


[OSM-dev] Truncating geometries

2015-11-09 Thread Malcolm Herring
Are there any tools out there that will properly truncate ways & 
multipolygons at bounding box boundaries, keeping closed ways & 
mutipolygons as properly formed areas?



___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev