22
Using Java XML Tool to Using Java XML Tool to process OSM XML data process OSM XML data Fangli Ying Peter Mooney Padraig Corcoran Adam Winstanley Department of Computer Science National University of Ireland, Maynooth Co.Kildare,Ireland

Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Using Java XML Tool to Using Java XML Tool to

process OSM XML dataprocess OSM XML data

Fangli Ying Peter MooneyPadraig CorcoranAdam Winstanley

Department of Computer ScienceNational University of Ireland, MaynoothCo.Kildare,Ireland

Page 2: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Commenced PhD project - Since October 2009Project supervisors: Peter Mooney ,Padraig CorcoranDirector of Study: Adam C.Winstanley

Publications:

• Polygon Processing in OpenStreetMap XML, GISRUK conference 2010

• Using Shape Complexity to guide simplification of geospatial data for use in Location-based Services (To Appear) , The 7th International Symposium on LBS & TeleCartography 2010

• Using Java XML Tool to Process OSM Data (Abstract), State of the Map 2010 Spain

• A Model for Progressive Transmission based on Shape Complexity, Submited to ACM GIS 2010

A model for progressive transmission of spatial data A model for progressive transmission of spatial data based on shape complexitybased on shape complexity -- OSM is a case studyOSM is a case study

Page 3: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

OpenStretMapOpenStretMapOpenStretMap

XMLXMLXML

UTMUTMUTM

OpenStreetMap---------a free geographic data

OpenStreetMapOpenStreetMap------------------a free geographic dataa free geographic data

Page 4: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

OSM Data IssuesOSM Data Issues

OSM data : available for download as XML format

� Large geographical area� Large number of vector data� Many kinds of custom feature tags� Hard to Process

Page 5: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Why are we using OSM XML

• Global coverage• On the fly transmitting• Custom data selection• Easy to edit• Analysis and comparing the data• Data Consistency• … …

Page 6: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Data Extraction: download OSM data for LBS device

Many limitations in Location-based Service device� —limited storage space, lack of GPS capable component, poor

network speed

Our Software

� ---Select the OSM data in a small area and Process Data by Stream:

Using OSM 6.0 API:

Page 7: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Java provides good support for working with XML data

Real Time Processing

Spatial Analysis

Editing dataWorking with OS XML Tools:JDOM,XMLBean,Sax,vtd-

xml,woodstox ….

Page 8: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

An example of DOM XML Processing

Page 9: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

DOM for OSM XML processing

• Easy Program• Efficient Query• Call the data any time

• Memory consuming• Slow pre build tree• No support for

streaming transmitting

Java Heap Error!

Java Heap Error!

Java Heap Error!

Java Heap Error!

Page 10: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

An example of SAX XML Processing

Page 11: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

SAX for OSM XML processing

• Streaming process• Efficient Memory handling

• Hard to program and maintain• Poor navigation ability to fetch the data• Element based queries

Page 12: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

An example of STAX XML Processing

Page 13: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

STAX for OSM XML processing

• Supports streaming• Memory efficient• Easy to Program and maintain• Event driven• Easy handling of custom

attributes/features

OSM XMLOSM XML

Page 14: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Scores of Opensource XML Tools

(1~10 is the score of convenience of use)

Stax covers more advantage for XML Processing

428Keeps data in memory

739Easy to program

794Speed

893Memory Usage

STAXSAXDOM

Page 15: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Query/navigating the OSM XML to the spatial data and information

For vector:

Way

Node

Ref

Latlon

For interesting features:

Waterway

Highway

Forest

Page 16: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Real Time Processing ProposalReal Time Processing Proposal

� User select Area from the OpenstreetMap and send request

� Using OSM API fetch XML file(Streaming)

� Process the XML Data Stream

� Create Java Objects for the XML Data

� Display or visualize the results of analysis(ie query or generlisation etc)

Page 17: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

PhD Research Topic: PhD Research Topic:

OSM Data for LBSOSM Data for LBSFaster, dynamic, display of OSM data for LBS applications by using shape complexity and polygon representation to guide data delivery

Some related topics:

Spatial Data Access

Polygon Generalization and Simplification

Progressive Transmission

Location Based Streaming

Many FOSS products

+ OSM XML Processing

Page 18: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Streaming OSM XML data using selective progressive transmission to LBS devices

Page 19: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Simplify the OSM data before delivery? Apply Shape Complexity Measures to Decide

Kmean=0.05800859

(measure of angles in the polygon)

N=77

(C,A):

Circularity=0.861512427

Area Ratio=0.011622088

Simple

Simplify

(Over-represented)

Page 20: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Combine a number of shape complexity measures to control the transmission of data

Kmean<0.01

N=647

(C,A):

Circularity=0.049611775

Area Ratio=0.515551784

Complex

Simplify

(Over-represented)

Page 21: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

Selective Progressive TransmissionSelective Progressive Transmission

� Applying Shape Complexity Measures to Spatial Data

� Preserving the Contour of the Shape Representation

Page 22: Using Java XML Tool to process OSM XML data › ~fying › AP › SOTM_Fangli_Ying_2010.pdf · for use in Location-based Services (To Appear) , The 7th International Symposium on

This work is focused on efficient delivery of spatial data to LBS devices

• Using OSM-XML data as a case-study (global-coverage)• Fast XML processing required• Progressively transmit data by selecting portions of the data

based on shape complexity criteria• Future Work: Full implementation of our selective

progressive transmission model