RE: [OpenMap Users] OpenStreetMap Layer

From: John McMahon <jmcmahon_at_mobilvox.com>
Date: Thu, 10 Jun 2010 15:20:06 -0400

Hi Don,

 

Thank you, you've been very helpful.

 

It's been going quite well except, sometimes, I feel like changing the
projection does not update the OMPolys. For example, when the layer is
created from a zoomed-out position, zooming in causes the lines to become
jagged and distorted. When the layer is created from a zoomed-in position
to start with, everything is fine (I can zoom out and zoom back in with no
distortion).

 

How do I get the OMPolys to completely redraw themselves to show more detail
as I zoom in?

 

Inside the prepare() method, I am already wiping out the OMGraphicList and
re-creating it from scratch. What else do I need to do?

 

Thanks,

 

John

 

From: Don Dietrick [mailto:dfdietrick_at_gmail.com]
Sent: Friday, May 21, 2010 9:14 AM
To: John McMahon
Cc: openmap_at_bbn.com; openmap-users_at_bbn.com
Subject: Re: [OpenMap Users] OpenStreetMap Layer

 

Hi John,

 

I think the entries at the end of the file define the roads that use the
points. The osm files I have have modes:

 

  <node id="163546" timestamp="2008-06-23T14:51:54" user="Dean Earley"
lat="50.7928559" lon="-1.0995028" />

  <node id="163547" timestamp="2006-12-05T03:17:47" user="Dean Earley"
lat="50.7940994" lon="-1.0983414" />

 

and then later:

 

 <way id="12166070" timestamp="2007-11-12T20:52:19">

    <nd ref="110314881" />

    <nd ref="110314568" />

    <tag k="highway" v="residential" />

  </way>

 

where the nd references tie back to the node entries. The tags of the ways
would let you determine how you want to render them.

 

I'd create OMPoly objects (without fill paint, using OMColor.clear or not
setting it at all)

 

 

On Fri, May 21, 2010 at 7:39 AM, John McMahon <jmcmahon_at_mobilvox.com> wrote:

Hi Don,

Thanks for your reply! It's been very helpful, but I had a question.

When I parse the OSM file, I'm basically left with a bunch of Lat/Long
points (with tags explaining what they are). From there am I suppose to
just use OMLines (or anything in the omGraphics package) to "connect the
dots" in order to show roadways and boundries? Are there any examples of
this in the source code?

Thanks for any help you can offer,

John




-----Original Message-----
From: Don Dietrick [mailto:dfdietrick_at_gmail.com]
Sent: Tuesday, May 18, 2010 8:10 PM
To: John McMahon
Cc: openmap_at_bbn.com; openmap-users_at_bbn.com
Subject: Re: [OpenMap Users] OpenStreetMap Layer

Hi John,

Thats certainly one way to do it, if the osm files are small enough to fit
into memory.

If you want to render an osm directly, you would create a new layer by
extending OMGraphicHandlerLayer, and override the prepare() method to create
and return an OMGraphicList for display. You would parse the osm file and
create OMGraphic objects to add to that list.

For larger files, (and a faster-responding map), you would want to create
image tiles. openstreetmap.org has details on how to create your own tile
set from the osm files. If you have those, you can use the
com.bbn.openmap.layer.image.MapTileLayer to display them (it's in the beta
version available via svn on the website).

Hope this helps,

Don


On May 18, 2010, at 5:19 PM, John McMahon wrote:

> Hello All,
>
> I would like to create an OpenStreetMap layer for OpenMap, and I was
wondering if anyone had done this before and what it requires. I have
OpenStreetMap data in the form of an .osm XML file. Will I just have to
parse that XML file and create a class that extends OMGraphicHanderLayer?
>
> I am fairly new to both OpenMap and OpenStreetMap, so any help would be
appreciated.
>
> Thanks,
> John

 



--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Jun 10 2010 - 15:52:25 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT