pointMapper 2.0 Manual

Tiling

Recall that the following command adds a tiling described by the file at url as a layer with name lynm.

pm_createTiling(lynm,url);

The format of a tiling description file is illustrated by the following example, which describes the tiled Boston map in our map catalog.


<?xml version="1.0" encoding="iso-8859-1" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:map="http://fabl.net/vocabularies/geography/map/1.1/"
xmlns:geom2d="http://fabl.net/vocabularies/geometry2d/1.1/"
xmlns:geom="http://fabl.net/vocabularies/geometry/1.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<map:Tiling>
<map:srs rdf:resource="http://fabl.net/vocabularies/geography/SRSCatalog/utm19n"/>
<map:tileUrlRoot>/pointmapper/basemaps/us/ma/boston_1/m10000/localroads/t</map:tileUrlRoot>
<map:tileUrlExtension>swf</map:tileUrlExtension>
<map:tilingOrigin>
<geom2d:Point>
<geom:x>330000.000000</geom:x>
<geom:y>4690000.000000</geom:y>
</geom2d:Point>
</map:tilingOrigin>
<map:tileCoverage>10000.000000</map:tileCoverage>
<map:tileExtent>500.000000</map:tileExtent>
<map:coverage>
<geom2d:Box>
<geom:xmax>360000.000000</geom:xmax>
<geom:xmin>300000.000000</geom:xmin>
<geom:ymax>4720000.000000</geom:ymax>
<geom:ymin>4660000.000000</geom:ymin>
</geom2d:Box>
</map:coverage>
<dc:identifier rdf:datatype="http://nurl.org/0/fabl/id">localroads_m10000</dc:identifier>
</map:Tiling>
</rdf:RDF>

Now, we'll walk through the file step by step, explaining the meaning of each part. First there is the header (which is the same as required for other PointMapper XML files):

<?xml version="1.0" encoding="iso-8859-1" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:map="http://fabl.net/vocabularies/geography/map/1.1/"
xmlns:geom2d="http://fabl.net/vocabularies/geometry2d/1.1/"
xmlns:geom="http://fabl.net/vocabularies/geometry/1.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>

This defines the requisite namespaces.

<map:srs rdf:resource="http://fabl.net/vocabularies/geography/SRSCatalog/utm19n"/>

defines the map projection - in this case, Universal Transverse Mercator, zone 19 north. See the RDFMap specification for more detail.

Next follows the definition of the tiling itself.

<map:Tiling>
  <map:tileUrlRoot>/pointmapper/basemaps/us/ma/boston_1/m10000/localroads/t</map:tileUrlRoot>
  <map:tileUrlExtension>swf</map:tileUrlExtension>

The swf files which make up the tiling are named <tileUrlRoot>_<xIndex>_<yIndex>. <tileUrlExtension>, with negative indices preceded by "m". In this instance, the tile with index 3 in x and -2 in y has the path:

/pointmapper/basemaps/us/ma/boston_1/m10000/localroads/t_3_m2.swf

The coverage and extent of individual tiles are given by:

<map:tileCoverage>10000</map:tileCoverage>
<map:tileExtent>500</map:tileExtent>

"Coverage" refers to distances in the projection being used. In this example, the projection is Utm19, so coverage is measured in meters. "Extent" refers to image coordinates - in this case, swf coordinates. Tiles are square, so x and y dimensions need not be specified separately.

The above lines assert 1) that each tile represents an area of 10000 by 10000 in the units of the current projection - meters - and 2) that the width of the tiles in image (swf) coordinates is 500. Tiles are scaled by PointMapper in such a way that the area in the image taken by a tile matches its stated coverage. For example, if zoomed to where 10000 meters of territory are visible in the X dimension, a tile will be scaled to evenly fit the width of the display area.

Tiles are assumed centered on the origin. So, when generating swfs for use as tiles, always arrange for the center of the area depicted by the tile to appear at image coordinates (0,0). In this case, image coordinates within each tile are asserted to range from -250 to 250 in x and y.

The origin of the tiling is specified, in coverate coordinates, by:


  <map:tilingOrigin>
    <geom2d:Point>
      <geom:x>330000</geom:x>
      <geom:y>4690000</geom:y>
    </geom2d:Point>
  </map:tilingOrigin>

This means that tile t_0_0.swf is placed so that its lower-left corner appears at 330000, 4690000 in projected coordinates (330 kilometers easting, 4690 kilometers northing, in UTM). Recall that tiles cover 10 kilometers in projected coordinates. Thus t_0_0.swf depicts the territory with UTM19 coordinates ranging from 330000 to 340000 easting, and 4690000 to 4700000 northing.

The coverage of the tiling as a whole is specified by:

<map:coverage>
  <geom2d:Box>
    <geom:xmax">360000</geom:xmax>
    <geom:xmin>300000</geom:xmin>
    <geom:ymin>4660000</geom:ymin>
    <geom:ymax>4720000</geom:ymax>
  </geom2d:Box>
</map:coverage>

Since tiles cover 10 kilometers each, and the tiling origin is at (330000,4690000), it follows that tiling indices range from -3 to 2 in x, and also -3 to 2 in y - and 36 tiles named t_m3_m3.swf through t_2_2.swf are expected to be present in the directory /pointmapper/basemaps/us/ma/boston_1/m10000/localroads/

The identifier for the tiling is given by:

<dc:identifier>localroads_m10000</dc:identifier>

And finally, the end-tags for the tiling:

</map:Tiling>
</rdf:RDF>

© Copyright 2004, 2005, 2006 Map Bureau