reverse geocoding

156 views
Skip to first unread message

Ronald Jones

unread,
Feb 7, 2024, 9:40:02 PMFeb 7
to Open Source CAD
the reverse geocoding feature doesn't seem to work as when i click on the map it shows blank bubble and it clears out the city and state in the call entry screen but will enter the lat and long. I've tried using Bing as the geocoding provider but all it shows on the map in the bubble that popups  is [object object] OH.

Open street map, does it use the reverse geo coding ?

Eric Osterberg

unread,
Feb 7, 2024, 9:49:34 PMFeb 7
to open-so...@googlegroups.com
There was a fix about 6 months ago that resolved the API providers changes to the URL for Geocoding. They basically required a trailing '/' to be removed.
If you can apply the latest version, the issue will be resolved.

I'm not aware of Bing being supported or enabled with TicketsCAD. Maybe you can share more information about that?

You can always grab the very latest beta or work in progress at: https://github.com/openises/tickets/archive/refs/heads/main.zip


On Wed, Feb 7, 2024 at 7:40 PM Ronald Jones <mike20...@gmail.com> wrote:
the reverse geocoding feature doesn't seem to work as when i click on the map it shows blank bubble and it clears out the city and state in the call entry screen but will enter the lat and long. I've tried using Bing as the geocoding provider but all it shows on the map in the bubble that popups  is [object object] OH.

Open street map, does it use the reverse geo coding ?

--
You received this message because you are subscribed to the Google Groups "Open Source CAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-source-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open-source-cad/42e129e6-4b0d-421c-a730-c898bba08dc4n%40googlegroups.com.

Ronald Jones

unread,
Feb 7, 2024, 9:57:27 PMFeb 7
to Open Source CAD
i have the latest tickets version

Eric Osterberg

unread,
Feb 7, 2024, 11:25:24 PMFeb 7
to open-so...@googlegroups.com
I am sorry I don't have any quick answers for you. I have not explored the other geocoding providers. I was aware of the faults in the default geocoder 6 months ago and provided a patch once the issue was discovered.

Maybe others have ideas or you can provide screenshots that demo the problem?

image.png

I was just reviewing the installation I have before me... And while it shows the version to be v3.40.3, I know that it does not have the fixes that are in the newest code.

For troubleshooting, What I did was:
1) open the screen where I expected GeoCoding to work.
2) open the debugger in my web browser... (I'm using firefox, Click Tools, Browser Tools, Web developer tools)
3) click the "network tab" in the developer plane.
image.png
4) Once I had this visible, I clicked on the map and watched the developer tools area where I saw a 404 error message.
5) I clicked into the details of the 404 error and found the URL the javascript was trying to load.
6) when I loaded that into a new browser tab... I saw the error from the API provider telling me the URL had changed.
image.png
7) this told me the URL changed and I needed to remove the trailing slash...
  And I know this change(fix) is in the latest version.
   So for me to verify this is working... I'll need to update to the latest version of the code.  My own system here in Arizona where I am for the next week, needs to be updated.

So to hunt this down for you...
Looks like the file that changed was js/Control.Geocoder.js
And you need the latest, rather than the newest "release".  So please use the version at: https://github.com/openises/tickets/archive/refs/heads/main.zip
Or explore the links above and apply the patch to js/Control.Geocoder.js

Hopefully this fixes the issue for you.

Ronald Jones

unread,
Feb 8, 2024, 4:51:52 PMFeb 8
to Open Source CAD

default city and state disappear when clicking on the map for geocoding. the only fields that updates is the lat/long USNG. i looked at the reference you field in fire fox and in chrome both say that geocoding is good just dont know why the map returns blank information

Screenshot 2024-02-08 164812.png

Screenshot 2024-02-08 165052.png
Screenshot 2024-02-08 163631.pngScreenshot 2024-02-08 164018.png

Eric Osterberg

unread,
Feb 8, 2024, 8:53:58 PMFeb 8
to open-so...@googlegroups.com
When you capture the connection to the Geocoder, can you cut and paste that URL into a new browser window and inspect the results?

Eric Osterberg

unread,
Feb 8, 2024, 8:57:04 PMFeb 8
to open-so...@googlegroups.com
In my case, this is what was returned.
_l_geocoder_2({"place_id":77249893,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","osm_type":"relation","osm_id":148838,"lat":"39.7837304","lon":"-100.445882","class":"boundary","type":"administrative","place_rank":4,"importance":0.9356913674575887,"addresstype":"country","name":"United States","display_name":"United States","address":{"country":"United States","country_code":"us"},"boundingbox":["-14.7608358","71.5889534","-180.0000000","180.0000000"]})
Not sure if anyone else can verify this is working for them?

I'll be happy to update the project when a solution is available.

mike

unread,
Feb 8, 2024, 9:33:04 PMFeb 8
to open-so...@googlegroups.com

this is what was returned when copy/past into a new browser tab
_l_geocoder_0({"place_id":77249893,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","osm_type":"relation","osm_id":148838,"lat":"39.7837304","lon":"-100.445882","class":"boundary","type":"administrative","place_rank":4,"importance":0.9356913674575887,"addresstype":"country","name":"United States","display_name":"United States","address":{"country":"United States","country_code":"us"},"boundingbox":["-14.7608358","71.5889534","-180.0000000","180.0000000"]})

jms.comp...@gmail.com

unread,
Feb 9, 2024, 10:31:50 AMFeb 9
to Open Source CAD


ZoomLevel - Level of detail required for the address. This is a number that corresponds roughly to the zoom level used in XYZ tile sources in frameworks like Leaflet.js, Openlayers etc. In terms of address details the zoom levels are as follows:

Try setting your Zoon from -4 to either 

   17 - Major and MMinor Street    
    or 
   18 - Building 


{"place_id":13489971,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","osm_type":"way","osm_id":575213527,"lat":"40.71273945","lon":"-74.00593904130275","class":"amenity","type":"townhall","place_rank":30,"importance":0.4208031717481289,"addresstype":"amenity","name":"New York City Hall","display_name":"New York City Hall, 260, Broadway, Lower Manhattan, Manhattan Community Board 1, Manhattan, New York County, New York, 10000, United States","address":{"amenity":"New York City Hall","house_number":"260","road":"Broadway","quarter":"Lower Manhattan","neighbourhood":"Manhattan Community Board 1","suburb":"Manhattan","county":"New York County","city":"New York","state":"New York","ISO3166-2-lvl4":"US-NY","postcode":"10000","country":"United States","country_code":"us"},"boundingbox":["40.7124450","40.7130254","-74.0064455","-74.0055687"]}


2024-02-09 10_28_52-.png

Ronald Jones

unread,
Feb 13, 2024, 12:56:06 AMFeb 13
to Open Source CAD
reverse.png
I tried the zoom level suggestion but still the same result with blank Bubble icon and city and state being removed from the fields for new call entry. not sure if this would have anything to do with the geocoding or not.

jms.comp...@gmail.com

unread,
Feb 13, 2024, 10:12:58 AMFeb 13
to Open Source CAD

Robert,  

   As I read the two Deprecation Warnings they do not apply here.  This is not a single object by OSM id lookup and the URL being referenced is reverse not the older reverse.php.

   As I posted using the Lat & Lon you provided above and Zoom level of 18 (note you had -4) the API returned the data expected.  

   ---

mike

unread,
Feb 13, 2024, 4:19:27 PMFeb 13
to open-so...@googlegroups.com
I was able to get the zoom to change to 18 and it’s still the same result

Sent from my iPhone


Eric Osterberg

unread,
Feb 13, 2024, 4:56:38 PMFeb 13
to open-so...@googlegroups.com
The version v3.42.0 was officially released 10 minutes ago.
This is exactly the same as the "HEAD" or https://github.com/openises/tickets/archive/refs/heads/main.zip version, with the version number being updated to remove any doubt about what version a person is running.
You can also find this on SourceForge at: https://sourceforge.net/projects/openises/files/   I am going to recommend you grab the versions from GITHUB as that's where we're maintaining the software now.
If you only want to run "Releases", you'll find those at: https://github.com/openises/tickets/releases

Numerous fixes are in this "Release".  You can follow changes to the code, line by line, with a description of why at: https://github.com/openises/tickets/commits/main/
Learning GIT is an awesome thing to do.
When you learn to manage an installation with it, updating your system can be as simple as running this command in the shell: "git pull".
Then you're all done.  Simple as that, and you have the very latest version.

jms.comp...@gmail.com

unread,
Feb 13, 2024, 11:30:04 PMFeb 13
to Open Source CAD

So I am not as familiar with this code as many here -- 

But as noted above -- control.geocoder.js 

Line 310 -- Function that builds the Query Executes it and Returns the results -- 

The 
Line 367 - Seems to build the URL setting fro the Query at 310 -- But Line 371 is doing some interesting math instead of just setting a Zoom Level?  

Also,  
In the resulting URL that I tested in a Browser is the json_callback and I am not sure where this parm or value comes froms. 

But at least in my browser I get exactly what I would have expected and the only change here is from -4 to 18,. 
_l_geocoder_0({"place_id":24674837,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","osm_type":"way","osm_id":366882348,"lat":"41.500068549999995","lon":"-81.68539577310509","class":"building","type":"apartments","place_rank":30,"importance":9.99999999995449e-06,"addresstype":"building","name":"The Ivory on Euclid","display_name":"The Ivory on Euclid, 1020, Euclid Avenue, Downtown Cleveland, Cleveland, Cuyahoga County, Ohio, 44114, United States","address":{"building":"The Ivory on Euclid","house_number":"1020","road":"Euclid Avenue","neighbourhood":"Downtown Cleveland","city":"Cleveland","county":"Cuyahoga County","state":"Ohio","ISO3166-2-lvl4":"US-OH","postcode":"44114","country":"United States","country_code":"us"},"boundingbox":["41.4998328","41.5003039","-81.6856307","-81.6850928"]})

Hope this helps some -- But if not just disregard it.

mike

unread,
Feb 14, 2024, 8:57:52 AMFeb 14
to open-so...@googlegroups.com
It seems to capture the relevant information but does not input location into the call entry ( city, state, address, and a blank icon bubble. This use to work in early version of tickets 2.x. Not sure if the code is missing something or not. I’ve updated to the version that was released yesterday 3.42.0. And still same. 

Sent from my iPhone


jms.comp...@gmail.com

unread,
Feb 15, 2024, 9:23:56 AMFeb 15
to Open Source CAD

In the module add.php --   Last change seemed to be 2013..  But, 

At Line 2312 looks like it would ignore your clicking on a map if a variable (switch) is not set.   

var theLocale = <?php print get_variable('locale');?>;
var useOSMAP = <?php print get_variable('use_osmap');?>;
var initZoom = <?php print get_variable('def_zoom');?>;
init_map(2, <?php print get_variable('def_lat');?>, <?php print get_variable('def_lng');?>, "", parseInt(initZoom), theLocale, useOSMAP, "tr");
var bounds = map.getBounds();
var zoom = map.getZoom();
var got_points = false; // map is empty of points
var doReverse = <?php print intval(get_variable('reverse_geo'));?>;
function onMapClick(e) {
if(doReverse == 0) {return;}
if(marker) {map.removeLayer(marker);}
if(myMarker) {map.removeLayer(myMarker);}
var iconurl = "./our_icons/yellow.png";
icon = new baseIcon({iconUrl: iconurl});
myMarker = new L.marker(e.latlng, {icon:icon, draggable:'true'});
myMarker.addTo(map);
newGetAddress(e.latlng, "ni");
};

map.on('click', onMapClick);
<?php
do_kml();
}

mike

unread,
Feb 15, 2024, 6:50:31 PMFeb 15
to open-so...@googlegroups.com
var theLocale = <?php print get_variable('locale');?>;
var useOSMAP = <?php print get_variable('use_osmap');?>;
var initZoom = <?php print get_variable('def_zoom');?>;
init_map(2, <?php print get_variable('def_lat');?>, <?php print get_variable('def_lng');?>, "", parseInt(initZoom), theLocale, useOSMAP, "tr");
var bounds = map.getBounds();
var zoom = map.getZoom();
var got_points = false; // map is empty of points
var doReverse = <?php print intval(get_variable('reverse_geo'));?>;
function onMapClick(e) {
if(doReverse == 0) {return;}  this would be the line you're referring to. 

if(marker) {map.removeLayer(marker);}
if(myMarker) {map.removeLayer(myMarker);}
var iconurl = "./our_icons/yellow.png";
icon = new baseIcon({iconUrl: iconurl});
myMarker = new L.marker(e.latlng, {icon:icon, draggable:'true'});
myMarker.addTo(map);
newGetAddress(e.latlng, "ni");
};

map.on('click', onMapClick);
<?php
do_kml();
}

Eric Osterberg

unread,
Feb 15, 2024, 6:59:38 PMFeb 15
to open-so...@googlegroups.com

Eric Osterberg

unread,
Feb 15, 2024, 7:37:54 PMFeb 15
to open-so...@googlegroups.com, Gavin Canon-Phratsachack
Looks like the API has changed again. The address attribute is not returned via this API method any longer.
https://nominatim.org/release-docs/develop/api/Reverse/ mentions this and requires people to use "address" lookup instead of "reverse". https://nominatim.org/release-docs/develop/api/Lookup/

I can see also when testing TicketCAD that the address attributes returned in this API query do not include the street address.  See this screenshot.
image.png

Unfortunately, JavaScript isn't really my area of expertise.
https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js appears to be the latest version and it's far different from what's included in TicketsCAD.
Howto for using the GeoCoder at: https://github.com/perliedman/leaflet-control-geocoder/tree/master

TicketsCAD version at: https://github.com/openises/tickets/blob/main/js/Control.Geocoder.js

Reply all
Reply to author
Forward
Message has been deleted
0 new messages