OpenSextant / OpenSextantToolbox

A geotagger and entity extractor
Other
15 stars 7 forks source link

Opensextant geo syntax question #21

Open dbapundit opened 4 years ago

dbapundit commented 4 years ago

In the README_server.txt it states.

-- General query in the form of : pairs (query must be URL-safe)

curl -X GET http://localhost:8182/opensextant/lookup/csv/query/name:Ka*%20AND%20cc:AF

-- query fields

name - place name

name_expanded - an expanded form of the name (only for name which are codes or abbreviations)

feat_class - the general type of feature. Valid values are A, P, L, H, V, S, T, R

feat_code - specific type of feature.

cc - ISO 2 character country codes

name_type - what type of name. Valid values are "name", "code" and "abbreviation"

geo - the point location (lat/lon) for the named place

I am looking to leverage the geo option with the name option, but I can't find an example of the correct format.

i.e. this is what I am trying to do.

(33.2421/65.43094) -> URL-SAFE -> %2833.2421%2F65.43094%29

curl -X GET http://localhost:8182/opensextant/lookup/csv/query/geo:%2833.2421*%2F65.43094*%29%20AND%20name:Kajran*

This is returning no matches

PlaceName ExpandedPlaceName NameType NameTypeSystem CountryCode Admin1 Admin2 FeatureClass FeatureCode Latitude Longitude Source

but I want it to return this.

PlaceName ExpandedPlaceName NameType NameTypeSystem CountryCode Admin1 Admin2 FeatureClass FeatureCode Latitude Longitude Source

Kajran name AF AF41 Geo.featureType.Area AREA 33.2421 65.43094 NGA

What I'm I doing wrong?

dlutz2 commented 4 years ago

Sorry for the slow response. I think you might have some extra characters in your URL, try removing the "*" after the numbers in the geocoords, like: http://localhost:8182/opensextant/lookup/csv/query/geo:%2833.2421%2F65.43094%29 AND name:Kajran

dbapundit commented 4 years ago

Thanks for your response, I am still getting errors when I attempted your recommendation. I tried some other variations.

[user@localhost ~]$ curl -X GET http://localhost:8182/opensextant/lookup/csv/query/geo:%2833.2421%2F65.43094%29 AND name:Kajran

Status page

Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

You can get technical details here.
Please continue your visit at our home page.

curl: (6) Could not resolve host: AND; Unknown error curl: (6) Could not resolve host: name; Unknown error

then I added %20 to fill in the spaces.

[user@localhost ~]$ curl -X GET http://localhost:8182/opensextant/lookup/csv/query/geo:%2833.2421%2F65.43094%29%20AND%20name:Kajran

Status page

Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

You can get technical details here.
Please continue your visit at our home page.

-- still failed with syntax error.

This partially works (with the OR clause instead of the AND the request, but notice that I had to put back the asterisk after each coordinate.

[user@localhost ~]$ curl -X GET http://localhost:8182/opensextant/lookup/csv/query/geo:%2833.2421*%2F65.43094*%29%20OR%20name:Kajran PlaceName ExpandedPlaceName NameType NameTypeSystem CountryCode Admin1 Admin2 FeatureClass FeatureCode Latitude Longitude Source Kajran name AF AF41 Geo.featureType.Area AREA 33.2421 65.43094 NGA Kajran name AF AF41 Geo.featureType.PopulatedPlace PPLA2 33.20357 65.47311 NGA Kajran name AF AF41 Geo.featureType.AdminRegion ADM2 33.21433 65.61748 NGA Kohe Kajran name AF AF41 Geo.featureType.Hypso MT 33.20493 65.38412 NGA Markaz-e Kajran name AF AF41 Geo.featureType.PopulatedPlace PPL 33.21137 65.47075 NGA Kuh-e Kajran name AF AF41 Geo.featureType.Hypso MT 33.20493 65.38412 NGA

This is what I ultimately need to work, but it returns no results.

[hadoop@localhost ~]$ curl -X GET http://localhost:8182/opensextant/lookup/csv/query/geo:%2833.2421*%2F65.43094*%29%20AND%20name:Kajran PlaceName ExpandedPlaceName NameType NameTypeSystem CountryCode Admin1 Admin2 FeatureClass FeatureCode Latitude Longitude Source

should return this.

Kajran name AF AF41 Geo.featureType.Area AREA 33.2421 65.43094 NGA

Something is wrong with my syntax.

Thanks


From: dlutz2 notifications@github.com Sent: Monday, December 9, 2019 5:19 PM To: OpenSextant/OpenSextantToolbox OpenSextantToolbox@noreply.github.com Cc: Burgess, Freddie Freddie.Burgess@maxar.com; Author author@noreply.github.com Subject: Re: [OpenSextant/OpenSextantToolbox] Opensextant geo syntax question (#21)

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

I think you might have some extra characters in your URL ( "*" after the numbers in the geocoords. Try this: http://localhost:8182/opensextant/lookup/csv/query/geo:%2833.2421%2F65.43094%29https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A8182_opensextant_lookup_csv_query_geo-3A-252833.2421-252F65.43094-2529&d=DwMCaQ&c=qv9gmtOiXdJCj9gMlMKtaw&r=rwWSNh7eziSqkMViqMUAql2k1XeKjMOd2FPbNLtdyew&m=8r1VspdORWQ4cW3rBjDI3U7GLJIWXORgQppvtosTcR0&s=WuWXjB9xz2HvtsqU1zrdE_ZWP4-udrCIVZSFlofJoPg&e= AND name:Kajran

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OpenSextant_OpenSextantToolbox_issues_21-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAN7EFR2OCGQK5WSZDNQS2XLQX277LA5CNFSM4JXBDPI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGK5CAQ-23issuecomment-2D563466498&d=DwMCaQ&c=qv9gmtOiXdJCj9gMlMKtaw&r=rwWSNh7eziSqkMViqMUAql2k1XeKjMOd2FPbNLtdyew&m=8r1VspdORWQ4cW3rBjDI3U7GLJIWXORgQppvtosTcR0&s=wDbBYRsknJ_b9_c7BGmNoZ2uvS17BVF63pxGf-CpFsQ&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AN7EFRYOHTUBRV2UPXFL3BLQX277LANCNFSM4JXBDPIQ&d=DwMCaQ&c=qv9gmtOiXdJCj9gMlMKtaw&r=rwWSNh7eziSqkMViqMUAql2k1XeKjMOd2FPbNLtdyew&m=8r1VspdORWQ4cW3rBjDI3U7GLJIWXORgQppvtosTcR0&s=N6yGSjii0R3b8_d_1e1leLMFvudM7s1Ck7S0nbkN2vc&e=.

dlutz2 commented 4 years ago

Try replacing the "/" between the geo coords with a comma.