[OSM-dev] [RFC] Add bounding box information to OSM files.

Etienne 80n80n at gmail.com
Sat Sep 16 20:42:27 BST 2006


On 9/16/06, Robert Hart <Robert.Hart at burohappold.com> wrote:
>
> <<ouputbbox.diff>>
>
>
> When OSM data is requested for a given bounding box some nodes will
> inevitably fall outside the specified area. This is the intended
> behaviour and is desireable.
>
> If that data is saved to a file, and later reloaded, (either in an
> editor or by a renderer), it is not possible to fully determine the
> bounding box. The resulting view/render has a jagged edge.
>
> The attached patch for JOSM adds bllat, bllon, trlat, and trlon
> attributes to the top-level <osm> element based on the current view.
>
> I have a rough hack to osmarender that well take those attributes,
> create a clip-path, and apply it to all map features (see
> http://wiki.openstreetmap.org/images/d/d0/CentralBath.png). This needs
> some clean-up (see 3. below)
>
>
> Questions.
>
> 1. Are there any objections to using these new attributes?
>
> 2. Where else should support be added for them?
>
> 3. Does anybody know how to write xslt that would allow the bounding box
> to be taken from osm-map-features.xml, if present, then from attributes
> in data.osm if present, or finally using the existing max and min nodal
> values from data.osm?


Something like this ought to work:

<xsl:choose>
  <xsl:when test='/rules/@bllat'>
    <xsl:variable name='bllat'><value-of select='/rules/@bllat'/>
    <xsl:variable name='blllon'><value-of select='/rules/@bllon'/>
    ...
  </xsl:when>
  <xsl:when test='$data/osm/@bllat'>
    <xsl:variable name='bllat'><value-of select='$data/@bllat'/>
    <xsl:variable name='blllon'><value-of select='$data/@bllon'/>
    ...
  </xsl:when>
  <xsl:otherwise'>
    <!-- existing code for bllat bllon etc goes here -->
  </xsl:otherwise>
</xsl:choose>

Etienne






Rob
> <<ouputbbox.diff>>  <<osmarender.xsl>>
>
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20060916/f52090f0/attachment.html>


More information about the dev mailing list