Is there a way to do reverse geocoding in Cesium, as long as we have lat and long?

90 views
Skip to first unread message

mar...@syncmesh.com

unread,
Oct 24, 2017, 5:05:13 PM10/24/17
to cesium-dev
1. A concise explanation of the problem you're experiencing.
I enter the latitude and longitude in the Search widget, and press the button. It seems to work, but the location (if I choose California for example) ends up in the middle of the ocean.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
Just using the built-in Bing Maps geocoder.


3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I need to implement reverse geocoding, in the simplest way possible. Again, it looks possible, but is inaccurate :(

4. The Cesium version you're using, your operating system and browser.
Cesium 1.38, Windows 10, Chrome.

1. A concise explanation of the problem you're experiencing.
How could I create an instance of the SearchManager (Bing API) in my cesium application?
Or is there an

4. The Cesium version you're using, your operating system and browser.
1.38 Windows 10, Chrome.

Gabby Getz

unread,
Oct 24, 2017, 5:12:55 PM10/24/17
to cesium-dev
Hi Martine,

The third party Geocoder service is what takes your query and returns a location, so unless you implement a custom geocoder, I don't think it's possible to change this behavior. Maybe latitude/longitude are in the opposite order? Do you have an example we could test?

Thanks,
Gabby


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Gabby Getz

unread,
Oct 24, 2017, 5:26:40 PM10/24/17
to cesium-dev
I mix up the order too often! 😆

The GeocoderViewModel is what controls the UI elements. You should be able to intercept the search command and implement custom logic before it's sent to the geocoder. Or you could set the searchText directly. I don't think we have sample code, but viewer.geocoder.viewModel will get you the GeocoderViewModel object.

On Tue, Oct 24, 2017 at 5:17 PM, <mar...@syncmesh.com> wrote:
> To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

>
> For more options, visit https://groups.google.com/d/optout.

I think you got it right, and indeed, the latitude/longitude are in the opposite order (i.e longitude/latitude). So it is not inaccurate anymore :)
However, is there a way to access the input to the search widget, so I can load it with a lat/long (or long/lat :) of my choosing?
Can you direct me to some sample code for this? (still learning cesium)
Thank you!

Martine

Martine Habib

unread,
Oct 24, 2017, 6:02:15 PM10/24/17
to cesiu...@googlegroups.com
I can indeed change the searchText, thank you so much...
However, if I want a complete reverse geocoding (to the nearest actual address) it looks like I will need to implement a custom geocoder, or add reverse geocoding to Cesium....
Thanks for the help :)

Martine

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/pNQG9mEF_5Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages