pbf_parser 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/pbf_parser/pbf_parser.c +5 -5
- data/ext/pbf_parser/pbf_parser.h +1 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72b430f0eb6a15d794fb46e5a0abb20f57fc17d1
|
4
|
+
data.tar.gz: dcae3bf18500db3c8b6d4108e7b2e1e7e70681b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3133b5fc953f64b3aca5d3bdc7d3acb4d06be5d7bfd42c20f73c173a4ba866f6deddfe114f9c2c27f5f50ea4d25e6b6081e21c00c0bb97137f2db8f11f8c70b
|
7
|
+
data.tar.gz: 68aca200b0b993d3c3d182e65d0c245af5da739076de5e6079086b2fe36c0f28db945bcc9288dd883009a7c4983094b6ee613c3bff1ec3704d6ae3db3135df3a
|
data/ext/pbf_parser/pbf_parser.c
CHANGED
@@ -290,8 +290,8 @@ static void process_nodes(VALUE out, PrimitiveGroup *group, StringTable *string_
|
|
290
290
|
lon = NANO_DEGREE * (lon_offset + (node->lon * granularity));
|
291
291
|
|
292
292
|
rb_hash_aset(node_out, STR2SYM("id"), LL2NUM(node->id));
|
293
|
-
rb_hash_aset(node_out, STR2SYM("lat"),
|
294
|
-
rb_hash_aset(node_out, STR2SYM("lon"),
|
293
|
+
rb_hash_aset(node_out, STR2SYM("lat"), FIX7(rb_float_new(lat)));
|
294
|
+
rb_hash_aset(node_out, STR2SYM("lon"), FIX7(rb_float_new(lon)));
|
295
295
|
|
296
296
|
if(node->info)
|
297
297
|
add_info(node_out, node->info, string_table, ts_granularity);
|
@@ -338,8 +338,8 @@ static void process_dense_nodes(VALUE out, DenseNodes *dense_nodes, StringTable
|
|
338
338
|
lon = NANO_DEGREE * (lon_offset + (delta_lon * granularity));
|
339
339
|
|
340
340
|
rb_hash_aset(node, STR2SYM("id"), LL2NUM(node_id));
|
341
|
-
rb_hash_aset(node, STR2SYM("lat"),
|
342
|
-
rb_hash_aset(node, STR2SYM("lon"),
|
341
|
+
rb_hash_aset(node, STR2SYM("lat"), FIX7(rb_float_new(lat)));
|
342
|
+
rb_hash_aset(node, STR2SYM("lon"), FIX7(rb_float_new(lon)));
|
343
343
|
|
344
344
|
// Extract info
|
345
345
|
if(dense_nodes->denseinfo)
|
@@ -385,11 +385,11 @@ static void process_dense_nodes(VALUE out, DenseNodes *dense_nodes, StringTable
|
|
385
385
|
static void process_ways(VALUE out, PrimitiveGroup *group, StringTable *string_table, int32_t ts_granularity)
|
386
386
|
{
|
387
387
|
unsigned j, k;
|
388
|
-
int64_t delta_refs = 0;
|
389
388
|
|
390
389
|
for(size_t i = 0; i < group->n_ways; i++)
|
391
390
|
{
|
392
391
|
Way *way = group->ways[i];
|
392
|
+
int64_t delta_refs = 0;
|
393
393
|
|
394
394
|
VALUE way_out = rb_hash_new();
|
395
395
|
|
data/ext/pbf_parser/pbf_parser.h
CHANGED
@@ -20,12 +20,7 @@
|
|
20
20
|
#define NANO_DEGREE .000000001
|
21
21
|
|
22
22
|
#define STR2SYM(str) ID2SYM(rb_intern(str))
|
23
|
-
|
24
|
-
/*
|
25
|
-
Deal with floating point accuracy problems while calculating lat and lon.
|
26
|
-
8 decimal places gives a precision of ~1mm and AFAIK that's the maximum
|
27
|
-
precision used with OSM data (and most geo tools). */
|
28
|
-
#define FIX8(num) rb_funcall(num, rb_intern("round"), 1, INT2NUM(8))
|
23
|
+
#define FIX7(num) rb_funcall(num, rb_intern("round"), 1, INT2NUM(7))
|
29
24
|
|
30
25
|
void Init_pbf_parser(void);
|
31
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pbf_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrià Planas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|