« 2008年6月 | メイン | 2008年8月 »

SVG Mapの描画性能

先日の格納効率の記事に続き、描画性能の比較を行ってみました。

使用したデータは、

  1. 地球地図起源の日本の海岸線Gmapcoast_2
    SVG:0.9MB, GeoJSON: 1.6MB, KML: 2.3MB
  2. 地球地図起源の日本の道路Gmaproad
    SVG: 10MB, KML: 29MB
  3. 地球地図起源のオーストラリアの河川Aust_2
    SVG: 54MB

このうち、1と2は先日の記事でも使用したデータです。(ただし、属性データは除いてあります)

使用した環境は、以下になります。

SMT SVG Map Toolkit 0.6
FFX FireFox3.0.1
OPR Opera9.5
ASV Adobe SVG Viewer 3.0
REN Renesis Player 1.0
OLI OpenLayers 2.6 / Internet Explorer6
OLO OpenLayers 2.6 / Opera9.5
OLF OpenLayers 2.6 / FireFox3.0.1
GMI Google Maps / Internet Explorer6
GEO Google Earth 4.3

なお、全てPentium M 1.1GHz 768MB WindowsXP(JP)上で動作させています。

1のデータの測定結果(以下、単位は全て[秒])

SVGGeoJSONKML
SMTFFXOPRASVRENOLIOLOOLFOLIGMIGEO
0.6 1.5 1.2 1.7 0.7 Hang up 9 11 Hang up Stall 2.5

2のデータの測定結果 (OpenLayersとGoogleMapsには脱落してもらいました)

SVGKML
SMTFFXOPRASVRENGEO
2 19 11 17 6 43

3のデータの測定結果 (KMLには脱落してもらいました)

SVG
SMTFFXOPRASVREN
11 51 34 48 17

SVG Map Toolkitは、地図データの描画性能に着目してチューニングされているので、最も高速に処理できています。

一方、予測はしていましたが、javascriptでコーディングされたビューア(OpenLayersやGoogleMaps)の性能はネイティブコードのビューアには遠く及びません。様々なリソースを多く消費しているようで、動作も不安定です。"1" 程度のベクトルデータの描画は一般的にこなせる必要が有ると考えています(ZIP圧縮形式".svgz"にすれば、現代のwwwではごく普通のファイルサイズになります)が、普及しているPCのレベルではかなりきびしいようです。

Relationship between WMS and SVG Map

This page is English Version of the Japanese article of this blog.

WMS has weak points as pointed out in the article before. SVG Map can offer a complementary solution. Then, a concrete adjustment point of the specification of SVG Map and WMS is described as follows.

Cross-reference of specification:

  • In the specification of WMS, SVG is provided for as one of the format of map drawing.
  • In the specification of SVG Map, the GetMap request of WMS can be treated as one of the enhanced query part of URL.

Therefore, they have adjusted mutually.

Geographic coordinates of map:

  • SVG Map buries geographic coordinates as metadata in map data.
  • Geographic coordinates for the map appear on query part of the protocol in WMS.

Therefore, it is necessary to memorize the requested parameter in WMS to maintain geographic coordinates for the downloaded map. SVG Map will solve this problem.

Tiled map:

  • SVG Map supports tiling by preparing container SVG data. Container SVG data refers to the tile data by URL.
  • WMS can generate the tile of the arbitrary division. The tile can be accessed by enhanced URL (GetMap request).

SVG Map client doesn't know the access method to the map server excluding URL of tile data described in container SVG data. That is, the accesses other than these URL do not occur. Then, the server of WMS can achieve speed-up by caching URL described in container SVG data.

Layering:

  • SVG Map supports layering by preparing container SVG data. Container SVG data refers to each layers by URL. (That is the Hyper-Layering.)
  • WMS can generate the arbitrary layer. The layer can be accessed by enhanced URL.

On the other hand, the support of layering function on the server side is a difficult in the point of the performance.

Therefore, the WMS protocol and SVG Map adjust well, and will be able to have a supplementary relation.

Special purpose XML languages for WMS:

On the other hand, SVG Map doesn't basically support data other than the SVG format. (However, PNG and JPEG are supported. ) That is, the interpretation of data by proper XML languages for WMS (response data of GetCapability and GetFeatureInfo request) is outside the specification of SVG Map.
However, a considerable functions that those languages aims will be able to be converted into container SVG of SVG Map. This conversion will be able to be achieved by processing by javascript on the client side, or batch processing at data origination, or dynamic processing on server side etc. Convertible functions are as follows.

  • Notification of range of map that server offers
    SVG Map client doesn't know the access method to the map server excluding URL of tile data deployed in container SVG data. That is, the range of the map service can be transmitted to the client by deploying as URLs of container SVG.
  • Notification of kind of layers that server offers
    SVG Map client doesn't know the access method to the map server excluding URL of tile data deployed in container SVG data. That is, the kind of the layers that provides the map service can be transmitted to the client by deploying as container SVG.

GetMap Protocol:

On the other hand, there might be a lots of use cases that tells the server the value of a geographic view box of the viewer for the SVG Map platform. Therefore, sharing the means for it might be significant. And, it is appropriate to use query part of http GET as this means. The GetMap request of WMS will be able to be used as the concrete specification. We plan to establish this function as one of the specifications of SVG Map Profile.

WMSとSVG Mapの関係

以前の記事で指摘したように、WMSには問題点があります。SVG Mapは相補的にそれを解消する手段を提供することができます。そこで、以下にSVG MapとWMSの仕様の具体的な整合点を記載します。

仕様の相互参照:

  • WMSにとって、SVGは地図描画形式の一つとして規定されています。
  • SVG Mapにとって、WMSのGetMapプロトコルはURLのquery partの拡張の一つとして扱うことができます。

 従って相互に整合しているといえるでしょう。

地図の地理座標:

  • SVG Mapは地図データにメタデータとして地理座標を埋め込みます。
  • WMSでは地図の地理座標はプロトコルのquery partに現出します。

 WMS仕様のサーバからダウンロードした地図は、リクエストしたパラメータを地図データとは別に記憶しておかないと地理座標を失ってしまいます。SVG Mapはこの問題を解決するでしょう。

タイリング:

  • SVG Mapは、コンテナSVGデータを作ることで、タイリングをサポートします。コンテナSVGデータはタイルデータをURLによって参照します。
  • WMSは任意の区画のタイルを生成することができます。タイルは拡張されたURL(GetMapリクエスト)によってアクセスすることができます。

 SVG MapのクライアントはコンテナSVGデータに記載されたタイルデータのURL以外へのアクセス方法を知りません。すなわち、これらのURL以外のアクセスは起きないので、WMSのサーバはコンテナSVGデータに記載したURLをキャッシュすることで、高速化を実現できます。

レイヤリング:

  • SVG Mapは、コンテナSVGデータを作ることで、レイヤリングをサポートします。コンテナSVGデータは各レイヤーをURLで参照します。
  • WMSは任意のレイヤーを生成することができます。レイヤーは拡張されたURLによってアクセスすることができます。

 一方、サーバ側でのレイヤリングのサポートは性能面で難題です。

以上より、WMSの拡張されたhttpプロトコルの規定とSVG Mapは良く整合し、補完関係を持つことができるでしょう。

WMSの固有なXML言語:

 しかし、SVG MapはSVG形式以外のデータを基本的にはサポートしません。(ただし、PNGとJPEGはサポートします。)すなわち、WMSで規定されたXML言語(GetCapabilityやGetFeatureInfoリクエストのレスポンスデータ)の解釈は、SVG Mapの仕様の範囲外です。しかし、その言語が実現するかなりの機能は、コンテナSVGに変換することができるでしょう。この変換はデータ作成時のバッチ処理、サーバ側の動的処理、クライアント側のjavascriptによる処理などで実現できるでしょう。変換可能な具体的な機能は以下の通りです。

  • サーバが提供する地図の範囲:SVG Mapビューアは、コンテナSVGとして展開されたURL以外へのアクセス方法を知りません。すなわち、地図サービスの範囲はコンテナSVGとして展開することでクライアントに伝達できます。
  • サーバが提供するレイヤーの種類:SVG Mapビューアは、コンテナSVGとして展開されたURL以外へのアクセス方法を知りません。すなわち、地図サービス提供するレイヤーの種類はコンテナSVGとして展開することでクライアントに伝達できます。

GetMapプロトコル:

 一方、SVG Mapのプラットホームにとって、ビューアの地理的なビューボックスの値をサーバに通達するケースはしばしば考えられるでしょう。従ってその手段の共通化は有意義でしょう。そして、この手段としてhttp GETのquery partを用いることは妥当です。その具体的な仕様として、WMSの拡張されたHTTPプロトコルのうち、GetMapリクエストを利用することができるでしょう。この仕様をSVG Map Profileの仕様として公開する予定です。

Supplementation: SVG Map data divided into mosaic tegular

This page is English Version of the Japanese article of this blog.

In the explanation of SVG Map data divided into mosaic tegular, all tiles were assumed to be an equal size for the simplification. However, the arrangement of the tile can be arbitrarily specified in SVG Map according to the (x,y,width,height) attributes of the image element of the container file. Therefore, an individual tile need not be an equal size.
#Please refer to this article about the compare with other architectures.

The figure below is an appearance of the tile division of the coast lines data of Japan used with Tiny SVG Base Map content.
URL of the container is the following.
http://www.svg-map.org/svg/basemaps/GMapJpz/jpCoast.dbf.svgz
Because all contents of Tiny SVG Base Map are static files, you might understand the dividing mechanism by reading the source code.

Rtile

Embedded metadata

This page is English Version of the Japanese article of this blog.

There are use cases of storing the metadata (or semantics) excluding drawing in the SVG Map data, and doing processing that uses it. These processing corresponds to the processing done with GIS in general. Needless to say, the conspicuous processing of GIS is mapping of geospatial information.

Here, the object of the metadata might have the case of the entire document and the case of an individual graphics primitive in the document.

There is a geographic coordinates reference system description of SVG as an example of the former. The method of putting information described by RDF/XML in the metadata element right under the svg element is used as the notation.

And, the method similar to the former can be adopted for latter metadata. (However, it will use xlink to specify an individual graphics primitive. ) (Reference information) In addition, there is a method of storing the metadata of RDF/XML by setting up the metadata element as a child element of each graphics primitive, too. However, these methods are disadvantageous in the storage efficiency of data and processing efficiency of the viewer.
On the other hand, it seems that the microformats-like method of setting up metadata in each graphics primitives as attributes is effective in this viewpoint. (Reference information) This method doesn't violate the recommended specification of SVG, though this method doesn't conform to the notation of RDF/XML.
Especially, the following advantages are pointed out for processing efficiency.

  • Connection processing of separating information is unnecessary in the processing stage, because neither the graphics primitive nor metadata are separate in the document.
  • The optimization of the processing performance is easy, because the assumption of the insertion of an unspecified data structure (There are metadata structure below < metadata > elements. ) in individual graphics primitives is unnecessary.
  • It is easy to set the style to an individual figure based on metadata, by a simple tool such as text editors. (Of course, it is also possible to use XSLT. )
  • # Please refer to this article about the advantage of a storage efficiency side.

Moreover, the utilities of simple techniques such as microformats and GRDDL are acknowledged.
The SVG Map consortium will support metadata by this simple method by occasion of above.

Specification for embedment of metadata in individual graphics primitives

  • Metadata can be set up in each graphics primitive as attributes.
  • The data structure by corresponding RDF is as follows.
    <graphicsPrimitiveName id="ID" attributeName="attributeValue" .../>
    ==
    [ID]:(subject) -- attributeName:(predicate) --> [attributeValue]:(object)
    It is likely to be declared at the same time as follows.
    [ID]:(subject) -- rdf:type:(predicate) --> [graphicsPrimitiveName]:(object)
  • It is necessary to declare the namespace to the metadata's attribute respectively.
  • The attribute based on two or more vocabularies can be set by declaring two or more namespaces.
  • Literal (character string and numerical value, etc.) and resources (URL,URI) can be used as a property value. The limitation of the value is assumed to be dependence on the schema (RDF Schema is assumed as it. ) specified for a namespace declaration.
  • Two or more property values can be given to one attribute by using the comma separated value.
  • In the graphics primitive to which metadata is set, it is desirable that the id attribute is set. (When it is not set, it might be considered an anonymous node in the data structure of RDF. )

    Example:
     <svg  xmlns="http://www.w3.org/2000/svg"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:foaf="http://xmlns.com/foaf/0.1/"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
      <path id="t1"
          foaf:nick="O-BUILDNG"
          rdf:type="http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing"
          dc:title="OOX company building"
          stroke="green" d="....." />
     </svg>

The extension which realizes a free zooming map

This page is English Version of the Japanese article of this blog.

SVG is vector graphics data which can be expanded and contracted without a degradation of a rendition. However, since the same data is only expanded and contracted, an information content does not change following it. On the other hand, in digital map application, the functionality to change the information content displayed with expansion and contraction is often offered.

There may be general-purpose functionality which can control the visibility of each graphics primitive according to the scaling factor of a view to realize this functionality. It seems that it is pended for the moment although the specifications which realize this were examined in the disputation stage of SVG1.2 temporarily (source). Then, the SVG Map consortium considered that this functionality was indispensable in a Web map services, and was made to extend as SVG Map Profile.

Property to extend  :   figure-visibility
The property which sets the parameter for controlling the visibility according to a view scale to a graphics primitive 
The target containing element: Basic Shapes, <path>, <text>, <use>, <g>, <image>, <animation>

Format  :   figure-visibility="[minimum scale], [maximum scale]"
When a view scale is between A and B, the graphics primitive is displayed.
# Definition of a view scale
100x ([Length in the screen-coordinates system of the graphic] / [Length in the SVG coordinate system of the graphic]) [%]

Name space  :   The specifications extended as SVG Map Profile are embedded to a SVG data using Namespaces in XML specifications.
Namespace URL for SVG Map Profile  :   http://purl.org/svgmap/profile
Recommend prefix :   go

Example :
 <svg ... xmlns:go="http://purl.org/svgmap/profile">
  ....
  <circle cy="100" cy="100" go:figure-visibility="100,200"/>
 </svg>
A circle graphic is displayed between the scaling factors 1. to 2..

Figvis

The viewer which reads a map dynamically according to a view scaling factor

The mechanism which reads map data dynamically according to a view scaling factor is realized by extending the implementation requirements specification 2 of "SVG Map data divided into mosaic tegular" based on this extension.

The implementation requirements specification of a viewer
When this property is organized in the <image> (or <animation>) element, the map services which obtains map data dynamically according to a scale is constructed.
When the <image> element enters into the scaling-factor span which should be displayed, the viewer must implement at least the logic which obtains dynamically the graphics data which the <image> element is referring to.

Example:   Please refer to the map data (http://www.svg-map.org/svg/basemaps/worldMapZ.svg) introduced by "Tiny SVG Base Map Content".

Storage efficiency of SVG Map

We compared the store efficiency between a SVG Map format, a shapefile format, and GML (GML2).

2008.07.30 update: GeoJSON and KML were added. (They were converted from shapefile respectively with a free converter. )

When there is little information content of a property (metadata), the size of a SVG Map data is almost comparable as Shapefile. The store efficiency of SVGMap falls as the information content of a property increases. Since it is an XML format, the size of SVG Map is likely to become large, but since SVGMap describes almost all informations as not an element but the property of XML, it is relatively efficient.

On the other hand, the size of a GML data is more than double precision compared with them. It will be because GML has specifications which express almost all informations as a hierarchical XML element.

The efficiency of GeoJSON seems to be better than that of GML though it is lower than SVG Map. The efficiency of KML seems not to be good, for it is designed based on GML and is included the drawing style.

ShapefileGMLSVG MapGeoJSONKML
shape
(.shp)
property
(.dbf + .shx)
summary(shape + property)graphic
(shape + rendition style )
graphic + property
(embedded metadata)
shapeshape + propertygraphic
(shape + rendition style )
graphic
+property
1,025 58 1,083 2,446 910 1,175 1,613 1,990 2,322 5,446
10,741 7,361 18,102 59,940 10,136 21,475 14,914 28,572 29,639 160,980
156 97 253 1,093 136 405 216 527 437 2,793

Unit: KB

  1. The coastline in Japan which makes the GLOBAL MAP an origin (It has 7 properties)  Gmapcoast_2 
  2. The road in Japan which makes the GLOBAL MAP an origin (It has 11 properties) Gmaproad
  3. The building shape of the Toyonaka digital map sample (It has 13 properties) Toyonaka

Architectures of Tiled Map Services

Since it had the mosaic tile-like map data and the similar functionality of SVGMap, we evaluated Tile_Map_Service_Specification(TMS).

It seems that the differences between two specifications are as follows.

SVG Map TMS
Basic concept Versatility and generality are considered as important by extending the minimum metadata and logic to the basic specifications of general-purpose SVG. A build of a simplistic map services is considered as important with the hardcode like specifications in which TiledMapServices specialized using.
Projection

From an compatibility with original SVG, only the projection by the primary affine transformation is supported.

Some well known projections by which the preset was carried out as specifications can be used.
Data formats for tiling functionality The single data format by which few metadatas for a map were embedded at the general-purpose data format (SVG). Three data formats for a map services prepared for each functionality
Storage structure of tiles All of the filename and directory-name of a tile, and directory structure can be set up freely. The preset (hard code) of directory structure and the filename is carried out as specifications.
Splitting structure of tiles The splitting for a non-equality, a random splitting, a splitting with a gap which were optimized based on the density of a data are possible. Instead, a layout of a tile must be specified by an index data (container SVG). Only a splitting of the division into equal parts by which the preset was carried out as specifications is supported. Where, splitting size can be set up freely. Instead, an index data is compact.
Supported graphics type Vector(SVG) and Raster(JPEG,PNG) Raster?

It seems that those differences are caused by whether it was designed based on GIS, or general-purpose Web contents. We will choose fusion generative architectures, since we aim at Web which the geospatial map fused with various contents.

Note: NASA's OnEarth has tried the delivery of the hint information for obtaining a tiled map efficiently based on WMS. However, this looks like the extemporaneous (stop-gap) extended specifications of WMS.

SVG Map data divided into mosaic tegular

This page is English Version of the Japanese article of this blog.

This specifications offers format and processing method for SVG Map data divided into mosaic tegular

Free scrolling map services are provided by a lot of Web Map services including google Maps. The technology that achieves it will be classified into two.
One is a type that dynamically generates the map corresponding to the display area of the user agent from the geospatial data base. Its specifications are provided for as a open and standard like WMS. However, it tends to become heavy because of dynamic map generation process. (See also an article of NASA's OnEarth)
On the other hand, there are type that displays the data divided into mosaic tegular prepared beforehand after clipping and sticking together. This method is advantageous for making to higher performance.  In addition, it is advantageous also for the simplification and the lowering the cost of the server. It might be also possible to serve by ordinary httpd without DBMS and dynamic data generation. Therefore, many of services of the map on Web uses this kind of method. However, this method tends to be hard coded and is made for exclusive use at each services. Because a desirable segmentation methodology of the map tile and the access method to it might be different at each service, and the mechanism was achieved by exclusive ECMA SCRIPT program, and it becomes hard code and proprietary so far.

Then, SVG Map profile offers an open latter mechanism by securing the freedom of the segmentation methodology and generalizing the access method. And it is also possible to apply former method like WMS because the access method is ordinary HTTP.
This mechanism is achieved by applying a basic specification of SVG. It explains the method of achieving it as follows.

SVG Map data divided into mosaic tegular

The map tile files will be synthesized to one map with the SVG file that settles them as shown in figure. Thus, the SVG file that importing of other files and settles is called container SVG file.

Tile2_3

Here, the function for importing of the file is achieved by <image> element that SVG originally has. Example of container SVG file is shown as follows. The storage structure of each tile is free according to URL. The arrangement place of each tile is also free according to the (x,y,width,
height) attribute. However, it is necessary to describe the arrangement of all tiles into the container SVG file.

Container.svg

<svg ... viewBox="20 110 120 85">
<metadata ... />
<image   x="0"   y="0" width="100" height="70" xlink:href="0_0.svg"/>
<image x="100"   y="0" width="100" height="70" xlink:href="1_0.svg"/>
<image x="200"   y="0" width="100" height="70" xlink:href="2_0.svg"/>
<image   x="0"  y="70" width="100" height="70" xlink:href="0_1.svg"/>
<image x="100"  y="70" width="100" height="70" xlink:href="1_1.svg"/>
<image x="200"  y="70" width="100" height="70" xlink:href="2_1.svg"/>
<image   x="0" y="140" width="100" height="70" xlink:href="0_2.svg"/>
<image x="100" y="140" width="100" height="70" xlink:href="1_2.svg"/>
<image x="200" y="140" width="100" height="70" xlink:href="2_2.svg"/>
</svg>

It is possible to display it by sticking the map tile together by such a description according to an original SVG specification. Moreover, the segmentation methodology of the tile is considerably free. That is, the map where tiling was done can be displayed within the range of the original SVG specification for which W3C provides.

Note 1:  However, this is a story in the specification. It actually depends on the content of the viewer implementation. For instance, because svg cannot be referred in < image > element in the SVG viewer of Firefox at present yet, the tiling of SVG cannot be done. (If the tiles are jpeg, it seems to be able to do it. )
Note 2: Even as for hyper-layering that is the function for the main interoperability of SVG Map, container SVG file is important. In tiling, the importing data is arranged. On the other hand, they are piled up in hyper-layering. There are no changes in importing and the display of two or more data.

Implementation specification of viewer
The specification on the viewer side as the SVG Map profile is newly provided.

Requirement 1: First of all, the viewer in accordance with the SVG Map profile should be able to do the importing the SVG files by <image> element.

When the SVG viewer not devised reads container SVG, all the tile data to which the image element refers might try to be downloaded. The problem might be not brought up to the operation of the viewer because there are only nine pieces in the example above. However, a serious problem might occur for data from which is divided into 100x100 tiles for instance. Then the SVG Map viewer should have the following logics corresponding to the above-mentioned container SVG data.

Requirement 2: The viewer in accordance with SVG Map profile should be implementd the following logic at least.
When the area of <image> element (It is specified with w, y, width, and height property ) of the SVG document comes in contact with the view box of the viewer, the data to which <image> element refers are dynamically acquired.

It explains the mechanism in the following figure. [Explanatory drawing of display logic(swf animation)]
Green tiles are tile data that should be loaded.

  • First, because viewBox of the container is "20  110  120  85", lower left four files (0_1.svg, 1_1.svg, 0_2.svg, 1_2.svg) are acquired.
  • Here, it is assumed that the user did scrolling in an upper right direction. Then, the view box of the viewer moves. As a result, (0_0.svg,1_0.svg) and (2_0.svg,2_1.svg) are loaded one after another.
  • Yellow tiles are the data that became unnecessary because it came off from viewBox though loaded once. It depends on the viewer implementation whether maintains as long as the memory permits or throws.

Note: Only by this specification, when a wide view box where all tiles are displayed is specified, reading all tiles will start. In the article in the future, the explanation of the profile that enables the expansion and the reduced display is scheduled.

Geographic coordinates support

This page is English Version of the Japanese article of this blog.

The most important information of SVG Map data is an information for associating a SVG coordinate and geographic coordinates. It is described as a coordinate reference system (Coordinate Reference System) metadata.

The description rule of a SVG Map profile's coordinate reference system metadata is based on SVG1.1 specifications (Geographic Coordinate Systems).
However, in order to cancel the ambiguity of specifications and to simplify a implementation, the profile who performs a new restriction is defined.
A SVG Map profile's data must have a coordinate reference system metadata. It must be described by declaration by the following RDF/XML sentences.

  • Coordinate reference system property
    crs:CoordinateReferenceSystem
    A coordinate reference system which this documentation uses is declared
    Domain: SVG contents
    Range: A CRS type instance

    Name space of this property :
    xmlns:crs="http://opengis.org/xmldtds/transformations.dtd"
    This vocabulary is quoted from "Recommended Definition Data for Coordinate Reference Systems and Coordinate Transformations" which OGC recommended in the past.
    .
  • A CRS type instance
    For the moment, only a following CRS type instance is recommended.
    http://purl.org/crs/84

    Generally this resource is called WGS-84.
    However, it is a two-dimensional coordinate system, the first parameter (X) of that is a Longitude and the second parameter (Y) is a Latitude. And the unit is a "degree", respectively.
    This coordinate reference system is equivalent to "CRS:84" (Annex B3) which OGC defined for WMS1.3.0.

    Notes 1: We searched for URIs for
    "CRS:84". However, the appropriate one was not able to be found. Although we barely discovered the URN "urn:ogc:def:crs:OGC:1.3:CRS84", a clear declaration of that was not able to be found out. Then, we decided to organize purl(persistent URL) for "CRS:84".
    .
    Notes 2: On the other hand, "EPSG:4326" is known as one of the coordinate reference systems of WGS-84. However, the first parameter (X) of that is a Latitude and the second parameter (Y) is a Longitude.  That is, "CRS:84" which SVG Map uses has a reverse sequential order of a parameter compared with it.
    .
    Notes 3: purl is URIs which can be accessed by a web browser. The document for "CRS:84" can obtain from this uniform resource locator (http://purl.org/crs/84).
    .
    Restriction of CRS is because it is the advantage that an interoperability can be improved, making the implementation to a user terminal easy by setting CRS to one.  For example, when superimposing two or more maps, it becomes unnecessary to take into consideration the difference in a coordinate reference system as a matter of fact. WGS-84 coordinate system may be used by the geographic information of the majority on an internet. Furthermore, it is also a native coordinate reference system of GPS which many portable terminals are implementing. Consequently, the inconvenience by this restriction will not occur in a majority of applications.
    .
  • A SVG coordinates conversion property
    svg:transform
    The transformation between the coordinate value of a SVG contents and the coordinate value of a geographical coordinate reference system is given.
    Domain:  CRS type instance
    Range:   Text which can be used with a SVG transform property (it is generalizable as an affine transformation parameter)

    The transformation is as follows.
      SVG_X: X coordinate of a SVG data
      SVG_Y: Y coordinate of a SVG data
      Geo_X: The first parameter of geographic coordinates (By restriction of a CRS type instance, it is a Longitude.)
      Geo_Y: The second parameter of geographic coordinates (By the restriction of a CRS type instance, it is a Latitude.)
      a , b , c , d , e , f:  The applicable values of parameters(SVG transform(a,b,c,d,e,f) )

      SVG_X = a * Geo_X + c * Geo_Y + e
      SVG_Y = b * Geo_X + d * Geo_Y + f

    When this properties is not declared, it is considered that that value is matrix (1, 0, 0, 1, 0, 0). 
    .
  • Map projection for SVG Map
    The geographic coordinate transformation property of SVGMap is limited only the first affine transformation. Therefore, the projection that can be used with SVG Map is limited to the equirectangular projection (And, Plate Caree that is the derived form that takes the standard parallel on the equator).
    It is also possible to use the drawing with non-diagonal section of the affine transformation. (It corresponds to a drawing that rotated equirectangular projection. )
    This limitation will offer a practicable drawing in most use cases. However, it might be inconvenient in the map of the high latitude region etc.  However, the function built into beforehand by the rendering system of SVG can be used and because it is a simple linear transformation, implementation on user agent is facilitated. As a result, the scalability (especially, small terminal) will be improved.
    .
  • Example
    <?xml version="1.0" encoding="UTF-8"?>
    <svg xmlns="
    http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <metadata>
      <rdf:RDF
       xmlns:rdf="
    http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:crs="
    http://opengis.org/xmldtds/transformations.dtd"
       xmlns:svg="
    http://www.w3.org/2000/svg">
       <rdf:Description>
        <crs:CoordinateReferenceSystem
         rdf:resource="
    http://purl.org/crs/84"
         svg:transform="matrix(15.3631,0.0,0.0,-18.6994,-1889.2916,849.9202)"/>
       </rdf:Description>
      </rdf:RDF>
    </metadata>
    <circle cx="258.1401" cy="185.1558" r="10.0" stroke="none" fill="green"/>
    </svg>
    In this example, the metadata of the geographic coordinate reference system is expressed in the following RDF graphs in Notation 3.
    <This SVG Document> crs:CoordinateReferenceSystem http://purl.org/crs/84.
    <http://purl.org/crs/84> svg:transform "matrix(15.3631,0.0,0.0,-18.6994,-1889.2916,849.9202)".
    The parameters of the SVG coordinate transformation property are as follows.
    a=15.3631
    b=0.0
    c=0.0
    d=-18.6994
    e=-1889.2916
    f=849.9202
    And, geographic coordinates that correspond to SVG coordinates (258.1401,185.1558) at the center of < circle > figure become as follows.
    258.1401 =  15.3631 * Geo_X - 1889.2916
    185.1558 = -18.6994 * Geo_Y + 849.9202

    Geo_X(Longitude) = 139.7694
    Geo_Y(Latitude) =  35.5500

The index of SVG Map Profile 1.0

This page is English Version of the Japanese article of this blog.

SVG Map profile   1.0 (proposal) 2008.7.28 update

Abstract :
This specification describes the SVG Map profile 1.0.

A SVG Map profile is a profile who realizes the map services which satisfies the requirement indicated separately.

Svgmapstructure_5 The greater part of specifications for SVG Map are SVG itself. However, it is a little insufficient  to fulfill the requirements as map platform. Therefore, in spite of being based on SVG1.1Tiny specifications, in order that a SVG Map profile may improve the applicability to a map services, the following restricts and extensions are carried out.

See also

SVG Mapの格納効率

SVG Map形式とshapefile形式、それとGML(GML2)の間で、格納効率を比較してみました。

2008.07.30更新:GeoJSONとKMLも追加しました。(それぞれ、共通のShapefileから変換されたものです。変換はWeb上でフリーで提供されているツールで行っています。)

SVG Mapは、Shapefileと比べて属性(メタデータ)の情報量が少ない場合はほぼ同程度のサイズです。属性の情報量が多くなるとサイズは増加していきます。XML形式のため、サイズが大きくなりそうですが、SVGMapは、ほとんどの情報をXMLの要素ではなく属性として記述するので健闘してます。ただし、属性値だけでなく属性名の記述も個々に必要な分、メタデータの量が増えると分が悪くなります。

一方、GMLは、それらと比べて2倍以上サイズが大きくなってしまいます。GMLはほとんどの情報をXMLの要素として階層的に表現する仕様のためでしょう。

GeoJSONはSVG Mapほどではありませんが、GMLよりは効率が良さそうです。KMLは基本的にGMLベースの設計で描画スタイルも含まれるので効率は良くないようです。

ShapefileGMLSVG MapGeoJSONKML
形状
(shp)
属性
(dbf+shx)
合計(形状+属性)図形
(形状+描画スタイル)
図形+属性
(メタデータ埋込)
形状形状+属性図形
(形状+描画スタイル)
図形+属性
1,025 58 1,083 2,446 910 1,175 1,613 1,990 2,322 5,446
10,741 7,361 18,102 59,940 10,136 21,475 14,914 28,572 29,639 160,980
156 97 253 1,093 136 405 216 527 437 2,793

単位:KB

  1. 地球地図起源の日本の海岸線(7項目の属性)Gmapcoast_2 
  2. 地球地図起源の日本の道路(11項目の属性)Gmaproad
  3. 豊中市デジタルマップサンプルの建物形状(13項目の属性)Toyonaka

検索

注目エントリー

2008年8月

          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

最近のトラックバック