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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b93b6205fb6385cb5b3d69ec0f3a481872df70e7
4
- data.tar.gz: ffb0fcb9519e2fc77d52b547d9f325232d859af2
3
+ metadata.gz: 72b430f0eb6a15d794fb46e5a0abb20f57fc17d1
4
+ data.tar.gz: dcae3bf18500db3c8b6d4108e7b2e1e7e70681b4
5
5
  SHA512:
6
- metadata.gz: bcaf84d9bfd5744ed0adab77ed384e58c7cfb14ee9bfeb73b368b5b50289d918ca73ab5cc40fe88a83a6e22dc21b703fa350f30bf77521cfacafb78d5e1ce857
7
- data.tar.gz: 0c84f0292020e173a4b2bd300190b1a38e772be3c7dfd4795156eecc74a4dda9045d98da3671aa0e5a6037cd523df3d53aa8fd7435248efc11857c0a725abbdd
6
+ metadata.gz: a3133b5fc953f64b3aca5d3bdc7d3acb4d06be5d7bfd42c20f73c173a4ba866f6deddfe114f9c2c27f5f50ea4d25e6b6081e21c00c0bb97137f2db8f11f8c70b
7
+ data.tar.gz: 68aca200b0b993d3c3d182e65d0c245af5da739076de5e6079086b2fe36c0f28db945bcc9288dd883009a7c4983094b6ee613c3bff1ec3704d6ae3db3135df3a
@@ -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"), FIX8(rb_float_new(lat)));
294
- rb_hash_aset(node_out, STR2SYM("lon"), FIX8(rb_float_new(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"), FIX8(rb_float_new(lat)));
342
- rb_hash_aset(node, STR2SYM("lon"), FIX8(rb_float_new(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
 
@@ -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.3
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-04 00:00:00.000000000 Z
11
+ date: 2013-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler