The draw mechanism for vector data

45 views
Skip to first unread message

maven apache

unread,
May 24, 2013, 3:46:49 AM5/24/13
to osm...@googlegroups.com

Hi:

We are building an android application like OsmAnd which will display the vector based map data.
Beacuse we want to use our own map data rather than osm map's.  So we tried to do our own.


Now this is what we have done:
1) create the ruls for rendering features of diferent type

The rule is something like this:

<rule id="1" type="point">
  <filters scaleDenominator="5000000">
    <point color="red" size="14"></point>
    <label size="12" color="black"></label>
  </filters>
  <filters scaleDenominator="2000000">
    <point color="red" size="12"></point>
    <label size="10" color="black"></label>
  </filters>
.....
</rule>
<rule id="2" type="road...">
  <filters scaleDenominator="5000000">
    <line fillColor="red" fillWidth="10" strokeWidth="1" strokeColor="black"></point>
    <label size="12" color="black"></label>
  </filters>
.....
</rule>

2) request data for the current viewport.

3) get the collections of the features.

The collection is something like this:

[{featureTypeId:1,coordinates:[100,300],name:'Point1'},{featureId:2,coordinates:[100,200,300,400....,name:'Road1''}....]

4) iterate the collections and draw them one by one


However we meet some problems:

1) The road is not crossed well as expected. For example:http://snag.gy/ck1cn.jpg

As the picture shown, the two road should have the same order, one can not cover another.

2) the label.

How to handle the label of one feature to cover another label? And how to determite the locaiton of the label to make a googd look and feel of the map?

Since Osmand have done a wonderful job, so I think you guys may have the experiences of these problems.

Can anyone do me a favor?

Victor Shcherb

unread,
May 25, 2013, 7:00:02 AM5/25/13
to osmand
Hi,

I think you can try to find how Mapnik rendering is working because your style is very similar to Mapnik style.
Shortly saying : 
- roads are usually rendering in 2 attempts 
- Labels are moving along the roads until the place without intersection will be found


Victor





--
You received this message because you are subscribed to the Google Groups "Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages