Re: [OpenMap Users] convert GeneralPath[] to GraphicsList

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Thu, 16 May 2013 15:33:34 -0400

Hi SK,

Can't you look up the value of a coordinate in your two dimensional array? By grabbing the first coordinate in a GeneralPath and then looking up that value in the array with those indexes? You can then sort the GeneralPaths according to data value, and then render them in that order.

You can draw a GeneralPath directly to a graphic context, but whether it's good enough for your purposes, I don't know. If you want to pan and zoom - you can use OpenMap with a Cartesian projection and then create OMShape objects from the GeneralPaths on your layer. That might be easier if all you want to see is this data on a surface. It all depends on how you want to render things - if the coordinates of your data are geographic, and you want to draw them on top of other data, then you probably want to keep to the OMPoly approach and use Geo projections for rendering.


- Don

On May 16, 2013, at 2:54 PM, SK wrote:

> Thank you, David. I thought about it.
>
> I think, I must explain whole situation.
> I have a two-three-four hundred random points on map which provide me some data. For example pressure.
>
> I triangulate this points (JTS is great).
> I interpolate this triangulation to two dimensional array of floats.
> Next I give this array to MarchingSquares algorithm to get an array of GeneralPaths which are levels of pressure.
> Now I have 70-80 levels. And I really do not know which level must me above and which level must be below.
>
> I tried to draw GeneralPaths directly to graphic context but I think it is not good solution. Or it is good?
>
> CK
>
>
>
> On Thu, May 16, 2013 at 8:55 PM, David J. Ward <david.ward_at_synriga.com> wrote:
> CK,
>
> I had a situation where I needed to reverse the rendering order the OMGraphics to avoid larger shapes from obscuring smaller shapes.
>
> Cheers,
> David
> ---
> David J. Ward
> Founder & Principal Engineer
> Synaptic Rigamortis Inc.
> Transforming Complexity into Elegance
> 499 Casanova Avenue, Monterey, CA 93940
> Tel: 1.831.521.6531
> Email: david.ward_at_synriga.com
> Website: http://synriga.com/
> LinkedIn: http://www.linkedin.com/in/synriga
>
>
>
>
> Synaptic Rigamortis Inc is a Native American owned small business.
> Diversity certifications: NMSDC MBE, #BA11-0121; CUCP, DBE, #039495; CPUC, MBE, #11030158
>
>
>
>
>
>
>
> On May 16, 2013, at 6:54 AM, SK <karasiov_at_gmail.com> wrote:
>
>> Hi,
>> I created set of polys and it works. But now I need to fill those polys with different colors and it does not work. All Polys are displayed above each other. I think I need some OMGraphics with holes. I searched mailing list archives but did not get results.
>>
>> Is there any method to draw poly with holes? Or convert generalPath to something with holes?
>>
>> SK
>>
>>
>> On Sat, May 4, 2013 at 3:22 AM, Don Dietrick <dfdietrick_at_gmail.com> wrote:
>> Hi CK,
>>
>> What is in the GeneralPath? What kind of coordinates?
>>
>> In general, if they are lat/lon degrees, you can use a PathIterator to grab the values, and use them to create a double[] of lat, lon, lat, lon, etc values. Then you can create an OMPoly with those coordinates.
>>
>> The OMGraphicList is just a container, so you'd add the OMPoly to that if you have more than one and want to group them.
>>
>> Hope this helps,
>>
>> Don
>>
>> On May 3, 2013, at 10:06 AM, SK wrote:
>>
>> > How to convert array of GeneralPaths to GrathicsList?
>> >
>> > Thank you.
>> >
>> > CK
>>
>>
>
>

--
[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 May 16 2013 - 15:35:38 EDT

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