Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OData submission get parameter wkt doesn't work with linestrings #232

Closed
florianm opened this issue Sep 24, 2019 · 3 comments
Closed

OData submission get parameter wkt doesn't work with linestrings #232

florianm opened this issue Sep 24, 2019 · 3 comments
Assignees
Labels
enhancement New feature or behavior

Comments

@florianm
Copy link

While wkt seems to work with points, with linestrings it's geojson either way:

I'm using a form with a LineString location captured as GPS trace.

# Irrelevant bits: how we got there
library(ruODK)
ruODK::ru_setup(
  svc=paste0("https://odkcentral.dbca.wa.gov.au/v1/projects/1/forms/build_Turtle-Track-Tally-0-6_1564387009.svc"))
form_tables <- ruODK::odata_service_get()
data_main_raw <- ruODK::odata_submission_get(table = form_tables$url[1], wkt = TRUE)
data_main_raw <- ruODK::odata_submission_get(table = form_tables$url[1], wkt = FALSE)

# with wkt=true: the original ODK linestring?
$value[[75]]$overview
$value[[75]]$overview$location
[1] "-31.99626166666667 115.88462 7.5 2.6;-31.99626333333333 115.8848 10.7 2.4;-31.996265 115.88480833333332 10.5 2.1;-31.996265 115.88480833333332 10.5 1.4;-31.99626 115.88470000000001 9.5 1.7;-31.996253333333335 115.88465666666667 9.2 1.7;-31.996254999999998 115.88464833333335 9.3 1.7;"

# with wkt=false: same as above
$value[[75]]$overview
$value[[75]]$overview$location
[1] "-31.99626166666667 115.88462 7.5 2.6;-31.99626333333333 115.8848 10.7 2.4;-31.996265 115.88480833333332 10.5 2.1;-31.996265 115.88480833333332 10.5 1.4;-31.99626 115.88470000000001 9.5 1.7;-31.996253333333335 115.88465666666667 9.2 1.7;-31.996254999999998 115.88464833333335 9.3 1.7;"


# Testing a different form with POINT geom, wkt TRUE: WKT as expected
$value[[32]]$site_visit
$value[[32]]$site_visit$location
[1] "POINT (116.59571 -20.46029 -12.8)"

# wkt FALSE: GeoJSON as expected
$value[[32]]$site_visit
$value[[32]]$site_visit$location
$value[[32]]$site_visit$location$type
[1] "Point"

$value[[32]]$site_visit$location$coordinates
$value[[32]]$site_visit$location$coordinates[[1]]
[1] 116.5957

$value[[32]]$site_visit$location$coordinates[[2]]
[1] -20.46029

$value[[32]]$site_visit$location$coordinates[[3]]
[1] -12.8

$value[[32]]$site_visit$location$properties
$value[[32]]$site_visit$location$properties$accuracy
[1] 5

Is that a bug or a feature?

@issa-tseng
Copy link
Member

it wasn't clear to me how to represent accuracy with a linestring/polygon so i didn't touch them yet. any ideas?

@issa-tseng issa-tseng added enhancement New feature or behavior needs discussion Discussion needed before work can begin labels Sep 26, 2019
@florianm
Copy link
Author

florianm commented Sep 27, 2019

How would you feel about ignoring accuracy and just returning standard WKT/GeoJSON?
That would work at least for my use cases. If I needed to capture accuracy in addition to the geotrace, I could add a separate point feature (which supports accuracy).

@issa-tseng
Copy link
Member

issa-tseng commented Sep 27, 2019 via email

@issa-tseng issa-tseng removed the needs discussion Discussion needed before work can begin label Oct 9, 2019
@issa-tseng issa-tseng self-assigned this Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or behavior
Projects
None yet
Development

No branches or pull requests

3 participants