directoryfan

Forum Replies Created

Viewing 15 posts - 76 through 90 (of 112 total)
  • Author
    Posts

  • directoryfan
    Expired Member
    Post count: 157

    Thank you Guust and it is OK, I understand.

    In this case, I have to find a solution for the map. I don’t think that the visitors will intuitively change the CPT on the map. Maybe I’ll have to emphasize more the CPT menu on the map.

    Thanks again, Marius


    directoryfan
    Expired Member
    Post count: 157

    Thank you Guust for your time and explanation, but please answer this question:

    1. Why does automatically change the Popular Categories under the search on the GD/Location Homepage? If someone is changing the CPT from Places to Events in the search and the Popular Categories get changed to Events too, but the map does not change to that CPT, is this not confusing for the users? (I see the new CPT Events and the updated Popular Categories, but still the Places on the map)

    I would like to make the map on GD Homepage aware of the CPT change in the search, how and where can I do this? (Please consider, that GD Directory can be used also for local directories with just some CPTs and not just for big global directories with a lot of CPTs.)

    And thank you for your hint, I will use more widgets for the CPT Events on the GD Homepage.

    Greetings, Marius


    directoryfan
    Expired Member
    Post count: 157

    Hi, I’m using Firefox and I saw this and asked myself if you get another response as the long string in your development environment. After spending some hours reading about Nominatim API and the German state Baden-Württemberg and testing different locations I know now better about the right name resolving.

    OK, so the long string is in the JSON attribute display_name and the others attributes are splitted under the address attribute. And the other attributes are not for each OSM API call consistent. So the attribute city_district is actually never in the JSON response, and you will have its value just in the display_name.

    Here are all locations for Baden-Württemberg, here the params for the Nominatim API search call, here is the proper country address format for Germany (street house_number, postalcode place).

    1. In my opinion you should fill the listing form fields just with values like:
    Listing Address Field: road house_number, city|town|village
    Listing City/Location Field: city|town|village

    and nothing more. Like that you will have the address as the German norm. So please do not fill the fields with suburbs or neighborhoods of little villages and do not use that part of the display_address field like ‘Verwaltungsgemeinschaft X’ or ‘Verwaltungsverband X’. These are 2 administrative levels (maybe as the city_district) just in some German states and they are not consistent, so X can be also a region name instead a city name, see the example 6 below. Do never use them for anything.

    Here are some examples, to better understand the API response in this German state:

    Example 1: village near big city Lahr/Schwarzwald, with its administration in Lahr/Schwarzwald (the data for this village is in OSM not updated, in this case use always the village)

    searching for: ‘Luisenstraße 5, Kippenheimweiler′

    OSM will suggest the address: ’5, Luisenstraße, Kippenheimweiler, Verwaltungsgemeinschaft Lahr/Schwarzwald…’
    and the autofill for address: ’5, Luisenstraße, Kippenheimweiler, Verwaltungsgemeinschaft Lahr/Schwarzwald’
    it should be: ‘Luisenstraße 5, Lahr/Schwarzwald’
    can be: ‘Luisenstraße 5, Kippenweiler’

    and the autofill value for the City field: ‘Kippenweiler′
    it should be: ‘Lahr/Schwrzwald′
    can be: ‘Kippenweiler’

    
    
    {"display_name":"5, Luisenstraße, Kippenheimweiler, Verwaltungsgemeinschaft Lahr\/Schwarzwald, Ortenaukreis, Regierungsbezirk Freiburg, Baden-Württemberg, 77933, Deutschland",
          "class":"highway",
          "type":"residential",
          "importance":0.245,
          "address":{
             "house_number": "5",
             "road":"Luisenstraße",
             "village":"Kippenheimweiler",
             "county":"Ortenaukreis",
             "state_district":"Regierungsbezirk Freiburg",
             "state":"Baden-Württemberg",
             "postcode":"77933",
             "country":"Deutschland",
             "country_code":"de"
          }
       }

    Example 2: another village as in example 1

    searching for: ‘Ruländerstraße 5, Durbach′

    OSM will suggest the address: ‘5, Ruländerstraße, Durbach, St. Anton, Verwaltungsgemeinschaft Offenburg…’
    and the autofill for address: ‘5, Ruländerstraße, Durbach, St. Anton, Verwaltungsgemeinschaft Offenburg’
    it should be:’Ruländerstraße 5, Durbach’

    and the autofill value for the City field: ‘Durbach′
    it should be: ‘Durbach′

    
    
    {"display_name": "5, Ruländerstraße, Durbach, St. Anton, Durbach, Verwaltungsgemeinschaft Offenburg, Ortenaukreis, Regierungsbezirk Freiburg, Baden-Württemberg, 77770, Deutschland",
        "class": "building",
        "type": "yes",
        "importance": 0.331,
        "address": {
          "house_number": "5",
          "road": "Ruländerstraße",
          "residential": "Durbach",
          "suburb": "St. Anton",
          "village": "Durbach",
          "county": "Ortenaukreis",
          "state_district": "Regierungsbezirk Freiburg",
          "state": "Baden-Württemberg",
          "postcode": "77770",
          "country": "Deutschland",
          "country_code": "de"
        }
      }

    Example 3: little village

    searching for: ‘Unditzstraße 6, Schutterzell′

    OSM will suggest the address: ’6, Unditzstraße, Schutterzell, Ottenweier Hof, Neuried…’
    and the autofill for address: ‘6, Unditzstraße, Schutterzell, Ottenweier Hof’
    it should be: ‘Unditzstraße 6, Neuried’
    but can be: ’6, Unditzstraße, Schutterzell, Ottenweier Hof, Neuried’

    and the autofill value for the City field: ‘Neuried′
    it should be: ‘Neuried′
    can be: ‘Schutterzell’

    
    
    "display_name": "6, Unditzstraße, Schutterzell, Ottenweier Hof, Neuried, Ortenaukreis, Regierungsbezirk Freiburg, Baden-Württemberg, 77743, Deutschland",
        "class": "building",
        "type": "yes",
        "importance": 0.331,
        "address": {
          "house_number": "6",
          "road": "Unditzstraße",
          "residential": "Schutterzell",
          "suburb": "Ottenweier Hof",
          "village": "Neuried",
          "county": "Ortenaukreis",
          "state_district": "Regierungsbezirk Freiburg",
          "state": "Baden-Württemberg",
          "postcode": "77743",
          "country": "Deutschland",
          "country_code": "de"
        }

    Example 4: another normal village

    searching for: ‘Belzackerweg 6, Kappelrodeck′

    OSM will suggest the address: ‘6, Belzackerweg, Zuckerberg, Mattenmühle, Verwaltungsverband Kappelrodeck…’
    and the autofill for address: ‘6, Belzackerweg, Zuckerberg, Mattenmühle, Verwaltungsverband Kappelrodeck’
    it should be:’Belzackerweg 6, Kappelrodeck’

    and the autofill value for the City field: ‘Kappelrodeck′
    it should be: ‘Kappelrodeck′

    
    
    {"display_name": "6, Belzackerweg, Zuckerberg, Mattenmühle, Kappelrodeck, Verwaltungsverband Kappelrodeck, Ortenaukreis, Regierungsbezirk Freiburg, Baden-Württemberg, 77876, Deutschland",
        "class": "building",
        "type": "yes",
        "importance": 0.221,
        "address": 
          "house_number": "6",
          "road": "Belzackerweg",
          "neighbourhood": "Zuckerberg",
          "suburb": "Mattenmühle",
          "village": "Kappelrodeck",
          "county": "Ortenaukreis",
          "state_district": "Regierungsbezirk Freiburg",
          "state": "Baden-Württemberg",
          "postcode": "77876",
          "country": "Deutschland",
          "country_code": "de"
        }
      }


    Example 5
    : another little village

    searching for: ‘Messingstraße 10, Legelshurst′

    OSM will suggest the address: ’10, Messingstraße, Legelshurst, Willstätt, Ortenaukreis…’
    and the autofill for address: ’10, Messingstraße, Legelshurst’
    it should be:’Messingstraße 10, Willstätt’
    can be: ‘Messingstraße 10, Legelshurst’

    and the autofill value for the City field: ‘Willstätt′
    it should be: ‘Willstätt′

    
    
    {"display_name": "10, Messingstraße, Legelshurst, Willstätt, Ortenaukreis, Regierungsbezirk Freiburg, Baden-Württemberg, 77731, Deutschland",
        "class": "building",
        "type": "yes",
        "importance": 0.331,
        "address": {
          "house_number": "10",
          "road": "Messingstraße",
          "residential": "Legelshurst",
          "village": "Willstätt",
          "county": "Ortenaukreis",
          "state_district": "Regierungsbezirk Freiburg",
          "state": "Baden-Württemberg",
          "postcode": "77731",
          "country": "Deutschland",
          "country_code": "de"
        }
      }


    Example 6
    : example of town and why you should never use the part ‘Verwaltungsgemeinschaft …’ or ‘Verwaltungsverband …’ of the display_name string

    searching for: ‘Eichbühlstraße 5, Bad-Griesbach′

    OSM will suggest the address: ‘5, Eichbühlstraße, Spinnersberg, Bad Peterstal-Griesbach,Verwaltungsverband Oberes Renchtal…’
    and the autofill for address: ‘5, Eichbühlstraße, Spinnersberg, Verwaltungsverband Oberes Renchtal’
    it should be:’Eichbühlstraße 5, Bad Peterstal-Griesbach’

    and the autofill value for the City field: ‘Bad Peterstal-Griesbach′
    it should be: ‘Bad Peterstal-Griesbach′

    
    
    {"display_name": "5, Eichbühlstraße, Spinnersberg, Bad Peterstal-Griesbach, Verwaltungsverband Oberes Renchtal, Ortenaukreis, Regierungsbezirk Freiburg, Baden-Württemberg, 77740, Deutschland",
        "class": "building",
        "type": "yes",
        "importance": 0.221,
        "address": {
          "house_number": "5",
          "road": "Eichbühlstraße",
          "suburb": "Spinnersberg",
          "town": "Bad Peterstal-Griesbach",
          "county": "Ortenaukreis",
          "state_district": "Regierungsbezirk Freiburg",
          "state": "Baden-Württemberg",
          "postcode": "77740",
          "country": "Deutschland",
          "country_code": "de"
        }
      }

    2. I’ve tried to change your osm js code and add some more params in order to restrict and optimize the search and the country address format (feature request: could be very nice to have this options in the back-end for local directories)

    
    
    accept-language=<browser language string>
    <a href="https://wiki.openstreetmap.org/wiki/Bounding_Box">countrycodes</a>=<countrycode>[,<countrycode>][,<countrycode>]...
    viewbox=<x1>,<y1>,<x2>,<y2>
    bounded=[0|1]

    As my project is restricted to this German state:

    
    
    accept-language='de-DE'
    countrycodes='de'
    viewbox=7.5,47.6,10.5,49.8
    bounded=1

    But this did not work and I could not see the changes applied to the OSM search. Do I have to put it in other functions too as in geocodePositionOSM ?


    directoryfan
    Expired Member
    Post count: 157

    Hi Stiofan, this is working now much better. The most of the cases are now OK.

    As for

    example 1: village near big city Lahr/Schwarzwald, which is actually a suburb of the city

    searching for: ‘Luisenstraße 5, Kippenheimweiler′

    OSM will suggest the address: ’5, Luisenstraße, Kippenheimweiler, Verwaltungsgemeinschaft Lahr/Schwarzwald’

    and the autofill value for the City field: ‘Regierungsbezirk Freiburg′
    it should be: ‘Lahr/Schwarzwald′

    The suggested address does contain that part but there is no way for me to be able to reliably know what part of that string is a city/town.

    1. I cannot see in the API return for #1 the field with the value ‘Verwaltungsgemeinschaft Lahr/Schwarzwald’. It is the city_district ?

    2. Do you have a link to the OSM API docs for address autocomplete? Or do you have a list with all the name of the returned fields (state, state_district, etc.) ?


    directoryfan
    Expired Member
    Post count: 157

    Thank you,

    OK, in this case I will add an extra Popular Post View widget for Events. But, :), is the usability for the GD home page and Location page the optimal one?

    1. When I change the CPT Places to Events in the header search, the Search widget does trigger the featured Popular Categories below the search and does update it to show the Events categories. Why not to have also the option to automatically update the map and the other widgets too? Is this not confusing? Or at least the map, since I can add the two other widgets for Events too. What about, when I have a lot of CPTs?

    2. Did anyone try to make the content of the widgets on the GD home page aware of the selected CPT in the header search?


    directoryfan
    Expired Member
    Post count: 157
    This reply has been marked as private.

    directoryfan
    Expired Member
    Post count: 157
    This reply has been marked as private.

    directoryfan
    Expired Member
    Post count: 157

    Hi Guust and thank you for your attention.

    I’m talking just about the homepage. The widgets are the right ones in the homepage sections.

    1. call the homepage
    2. change in the header search just the CPT from Places to Events, without searching for a word or location
    3. this will automatically update the featured popular categories section below the header search on the homepage but not the content of the following widgets: map, popular places, latest places – all on the homepage.
    4. even if I manually change the CPT on the map widget to Events, the content of popular places and latest places on the homepage will not automatically update. (both widgets have the option “Use current viewing post type:” ticked.


    directoryfan
    Expired Member
    Post count: 157
    This reply has been marked as private.

    directoryfan
    Expired Member
    Post count: 157

    Thank you Patrik, I see that you have now a user account. This will be helpful with further questions.
    Marius


    directoryfan
    Expired Member
    Post count: 157
    This reply has been marked as private.

    directoryfan
    Expired Member
    Post count: 157

    Hello Alex,

    in my opinion, when adding a new listing the selected location from the OSM API for the field City is wrong. When the address is a village or even a village nearby and part of a bigger city, the suggested city is in a lot of cases the governmental district of the state, which is wrong. And the user cannot change manually the city, since OSM will replace it with the false one.

    My Project is a local one, just for the state Baden-Württemberg, Germany. And keep in mind the format of the OSM answer: ‘street nr, street, village, municipality(rural city), rural district, governmental district, state, postcode country’

    Example 1: village near big city Lahr

    searching for: ‘Luisenstraße 5, Kippenheimweiler′

    OSM will suggest the address: ’5, Luisenstraße, Kippenheimweiler, Verwaltungsgemeinschaft Lahr/Schwarzwald’

    and the autofill value for the City field: ‘Regierungsbezirk Freiburg′
    it should be: ‘Lahr′

    Example 2: normal village

    searching for: ‘Unditzstraße 6, Schutterzell′

    OSM will suggest the address: ’6, Unditzstraße, Schutterzell, Ottenweier Hof, Neuried’

    and the autofill value for the City field: ‘Regierungsbezirk Freiburg′
    it should be: ‘Neuried′

    So the suggestion is wrong, ‘Regierungsbezirk Freiburg′ is not a city/location it is a governmental district of the state with hundreds of cities/locations.

    a. Can you confirm the bug?
    b. Where and how can I change the call to the OSM-API? I need the files and some links to the docs for the calling params. I’ll try to work together with the German OSM community too.


    directoryfan
    Expired Member
    Post count: 157

    Hello Alex and thank you for your time.
    It took some time or saving steps of listings and profiles or it was a cache problem, but now is working, UsersWP does replace the gravatar placeholder on the listing detail page through the profile image after the last update.


    directoryfan
    Expired Member
    Post count: 157

    Hello Support Team,

    do you have an idea on how can I find a solution for the second and third question. Since I can not change afterwards the location and the location/city selection from the OSM API is wrong for smaller and urban cities, I do have a problem and I do not know how to fix it.

    Greetings, Marius


    directoryfan
    Expired Member
    Post count: 157

    Thank you, Alex, nice example. I’ll have to make some experience and then a tutorial about this for the users or even for the website visitors, that they can add information to the OSM or correct data, why not.

Viewing 15 posts - 76 through 90 (of 112 total)
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount