Skip to content
Browse files

We don't support geoid correction yet, rename the default layer type …

…to elliptical.
  • Loading branch information...
1 parent 967d9a2 commit d5d81da6456fa8cc075305db1d64a630f5a456cc @jedisct1 committed Feb 7, 2011
Showing with 18 additions and 17 deletions.
  1. +1 −1 README.markdown
  2. +2 −2 pincaster.conf
  3. +3 −2 src/app_config.c
  4. +1 −1 src/app_config.h
  5. +3 −3 src/domain_layers.c
  6. +3 −3 src/pandb.c
  7. +1 −1 src/pandb.h
  8. +2 −2 test/pincaster.conf
  9. +1 −1 test/test_utils.c
  10. +1 −1 test/tests.sh
View
2 README.markdown
@@ -252,7 +252,7 @@ Check the list of active layers:
"name": "restaurants",
"records": 0,
"geo_records": 0,
- "type": "geoidal",
+ "type": "ellipsoidal",
"distance_accuracy": "fast",
"latitude_accuracy": 0.0001,
"longitude_accuracy": 0.0001,
View
4 pincaster.conf
@@ -47,9 +47,9 @@ Timeout 20
# The default type of layer.
-# Should be one of: flat, flatwrap, spherical and geoidal.
+# Should be one of: flat, flatwrap, spherical and ellipsoidal.
-DefaultLayerType geoidal
+DefaultLayerType ellipsoidal
# The formula used for distance calculation in radius search.
View
5 src/app_config.c
@@ -138,8 +138,9 @@ int parse_config(const char * const file)
app_context.default_layer_type = LAYER_TYPE_FLATWRAP;
} else if (strcasecmp(cfg_default_layer_type_s, "spherical") == 0) {
app_context.default_layer_type = LAYER_TYPE_SPHERICAL;
- } else if (strcasecmp(cfg_default_layer_type_s, "geoidal") == 0) {
- app_context.default_layer_type = LAYER_TYPE_GEOIDAL;
+ } else if (strcasecmp(cfg_default_layer_type_s, "ellipsoidal") == 0 ||
+ strcasecmp(cfg_default_layer_type_s, "geoidal") == 0) {
+ app_context.default_layer_type = LAYER_TYPE_ELLIPSOIDAL;
} else {
ret = -1;
}
View
2 src/app_config.h
@@ -18,7 +18,7 @@
# define DEFAULT_ACCURACY ACCURACY_FAST
#endif
#ifndef DEFAULT_LAYER_TYPE
-# define DEFAULT_LAYER_TYPE LAYER_TYPE_GEOIDAL
+# define DEFAULT_LAYER_TYPE LAYER_TYPE_ELLIPSOIDAL
#endif
#ifndef DEFAULT_SERVER_PORT
# define DEFAULT_SERVER_PORT "4269"
View
6 src/domain_layers.c
@@ -338,8 +338,8 @@ int add_layer_name_to_json_gen(void *context_, void *entry,
type = "flatwrap"; break;
case LAYER_TYPE_SPHERICAL:
type = "spherical"; break;
- case LAYER_TYPE_GEOIDAL:
- type = "geoidal"; break;
+ case LAYER_TYPE_ELLIPSOIDAL:
+ type = "ellipsoidal"; break;
default:
type = "unknown";
}
@@ -352,7 +352,7 @@ int add_layer_name_to_json_gen(void *context_, void *entry,
(unsigned int) sizeof "distance_accuracy" - (size_t) 1U);
const char *accuracy;
if (pan_db->layer_type == LAYER_TYPE_SPHERICAL ||
- pan_db->layer_type == LAYER_TYPE_GEOIDAL) {
+ pan_db->layer_type == LAYER_TYPE_ELLIPSOIDAL) {
switch (pan_db->accuracy) {
case ACCURACY_VINCENTY:
accuracy = "vincenty"; break;
View
6 src/pandb.c
@@ -493,7 +493,7 @@ static int find_near_context_cb(void *context_, void *entry,
(void) sizeof_entry;
if (context->db->layer_type == LAYER_TYPE_SPHERICAL ||
- context->db->layer_type == LAYER_TYPE_GEOIDAL) {
+ context->db->layer_type == LAYER_TYPE_ELLIPSOIDAL) {
switch (context->db->accuracy) {
case ACCURACY_VINCENTY:
cd = vincenty_distance_between_geoidal_positions
@@ -792,7 +792,7 @@ static int find_in_rect_context_cb(void *context_, void *entry,
return 0;
}
if (context->db->layer_type == LAYER_TYPE_SPHERICAL ||
- context->db->layer_type == LAYER_TYPE_GEOIDAL) {
+ context->db->layer_type == LAYER_TYPE_ELLIPSOIDAL) {
cd = rhomboid_distance_between_geoidal_positions
(context->position, &scanned_slot->position);
} else {
@@ -842,7 +842,7 @@ static int find_in_rect_cluster_context_cb(void *context_, void *entry,
fabsf(center.longitude - rect->edge0.longitude)) / 2.0;
Meters radius;
if (context->db->layer_type == LAYER_TYPE_SPHERICAL ||
- context->db->layer_type == LAYER_TYPE_GEOIDAL) {
+ context->db->layer_type == LAYER_TYPE_ELLIPSOIDAL) {
radius = geoidal_distance_to_meters(distance);
} else {
radius = (Meters) distance;
View
2 src/pandb.h
@@ -53,7 +53,7 @@ typedef enum NodeType_ {
typedef enum LayerType_ {
LAYER_TYPE_NONE, LAYER_TYPE_FLAT, LAYER_TYPE_FLATWRAP,
- LAYER_TYPE_SPHERICAL, LAYER_TYPE_GEOIDAL
+ LAYER_TYPE_SPHERICAL, LAYER_TYPE_ELLIPSOIDAL
} LayerType;
typedef struct BareNode_ {
View
4 test/pincaster.conf
@@ -40,9 +40,9 @@ Timeout 20
# The default type of layer.
-# Should be one of: flat, flatwrap, spherical and geoidal.
+# Should be one of: flat, flatwrap, spherical and ellipsoidal.
-DefaultLayerType geoidal
+DefaultLayerType ellipsoidal
# The formula used for distance calculation.
View
2 test/test_utils.c
@@ -3,7 +3,7 @@
#include <assert.h>
int main() {
- assert(0.0 != gc_distance_between_geoidal_positions
+ assert(0.0 != gc_distance_between_ellipsoidal_positions
(&(Position2D){.latitude = 48.510, .longitude = 2.240}, &(Position2D){.latitude = 48.512, .longitude = 2.243}));
return 0;
}
View
2 test/tests.sh
@@ -39,7 +39,7 @@ EXPECTED=$(python -m json.tool <<EOF
{
"name": "tlay",
"nodes": 0,
- "type": "geoidal",
+ "type": "ellipsoidal",
"distance_accuracy": "fast",
"latitude_accuracy": 0.0001,
"longitude_accuracy": 0.0001,

0 comments on commit d5d81da

Please sign in to comment.
Something went wrong with that request. Please try again.