[GraphHopper] storing an additional byte field in the graph

Christophe Ponsard christophe.ponsard at cetic.be
Thu Nov 7 14:22:38 UTC 2013


Hi renaud
maybe we should contribute this.
Currently to ensure byte access in another of our storage,
I am using integer access with some classical masking operation
br
christophe

Le 7/11/2013 15:13, Peter K a écrit :
> The default behaviour is indeed: edgeEntryIndex += 4 ... just do =+1
> then as you suggested. Then access this byte field via the
> edgeEntrySize*edgeId+INDEX and the method edges.getBytes. To make
> getBytes working you need to disable the following optimization in
> GHDirectory:
> put("edges", DAType.RAM_INT_STORE);
>
> Which means: for 'edges' (and others) use an integer based DataAccess
> implementation as it is faster. But for them the getBytes is currently
> not implemented (pull requests welcome!) so you need to use a byte
> based DataAccess - e.g. just comment out the optimization for edges.
>
> Regards,
> Peter.
>
>> Hi Peter,
>>
>> For some dedicated application, I want to store an additional byte
>> field in every edge.
>> I have understood the mechanism for declaring fields, and implemented
>> something to handle byte fields.
>>
>> My point is that the underlying DataStorage do not seem to tolerate
>> that int are not aligned with the boundaries of their internal
>> segments. As such, I am obliged to represent my field as an int
>> instead of a single byte to ensure that the int are not crossing
>> boundaries of segments. I did not find any other idea to maintain the
>> alignment, since I did not see any API that I could call to maintain
>> this alignment from outside the DataStorage.
>>
>> This makes me a little bit sad because of wasted space.
>> Maybe you have a suggestion for me?
>>
>> --
>> *Renaud De Landtsheer, Ir, Phd*
>> Sr R&D Engineer
>> CETIC
>> Rue des Frères Wright, 29/3
>> B-6041 Charleroi
>> Phone: +32 71 490 754
>>
>>
>>
>>
>> _______________________________________________
>> GraphHopper mailing list
>> GraphHopper at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/graphhopper
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper


-- 
*Christophe PONSARD*
R&D Department Manager
CETIC
Rue des Frères Wright, 29/3
B-6041 Charleroi
Mobile: +32 472 56 90 99
Phone: +32 71 490 743


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20131107/1896852c/attachment.html>


More information about the GraphHopper mailing list