<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi renaud<br>
maybe we should contribute this. <br>
Currently to ensure byte access in another of our storage,<br>
I am using integer access with some classical masking operation<br>
br<br>
christophe<br>
<br>
Le 7/11/2013 15:13, Peter K a écrit :<br>
</div>
<blockquote cite="mid:527BA00A.6070206@yahoo.de" type="cite">
<pre wrap="">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.
</pre>
<blockquote type="cite">
<pre wrap="">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
<a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
GraphHopper mailing list
<a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<table cellspacing="0" width="400">
<tbody>
<tr>
<td colspan="2" style="border-left: 1px solid rgb(0, 102,
0); background-color: rgb(255, 255, 255); font-family:
arial; font-style: normal; font-variant: normal;
font-weight: normal; font-size: 14px; line-height: normal;
font-size-adjust: none; font-stretch: normal;
vertical-align: top;"> <b>Christophe PONSARD</b> </td>
</tr>
<tr>
<td colspan="2" style="border-left: 1px solid rgb(0, 102,
0); background-color: rgb(255, 255, 255); font-family:
arial; font-style: italic; font-variant: normal;
font-weight: normal; font-size: 14px; line-height: normal;
font-size-adjust: none; font-stretch: normal;
vertical-align: top;">R&D Department Manager</td>
</tr>
<tr>
<td colspan="2" style="border-left: 1px solid rgb(0, 102,
0); background-color: rgb(255, 255, 255); font-family:
arial; font-style: normal; font-variant: small-caps;
font-weight: normal; font-size: 14px; line-height: normal;
font-size-adjust: none; font-stretch: normal;
vertical-align: top;">
CETIC <br>
Rue des Frères Wright, 29/3 <br>
B-6041 Charleroi <br>
Mobile: +32 472 56 90 99 <br>
Phone: +32 71 490 743 </td>
</tr>
<tr>
<td colspan="2" style="border-top: 1px solid rgb(0, 102, 0);
background-color: rgb(255, 255, 255); font-family: arial;
font-style: italic; font-variant: normal; font-weight:
normal; font-size: 12px; line-height: normal;
font-size-adjust: none; font-stretch: normal;
vertical-align: top;" align="top">
<p><br>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>