Usage of Custom Area in Map Matching

Hi,
Now that my custom area successfully loads into the GH service - I’m not sure where I can use it.
I would like to add the custom area to the details returned from the map_matcher (similar to the country) .
when reviewing the response from the map_matcher I could not find it.
Any assistance would be appreciated

I reviewed the custom area PR and wasn’t able to see in which api the custom_area is exposed.

Any pointers would be apprciated

I don’t think the custom areas are accessible via path details at the moment. What would be the use case? Just returning if the route crosses a certain area? Couldn’t this be done on the client side with an “is in polygon”-check?

I reviewed the custom area PR

Note that this PR was not merged. See this PR instead.

Thx @karussell for you responce.
The use-case would be to return a certain AOI in the map matching.
currently the details returns the country, and we would like to return the state or county level

Regarding state: this should already work when you add the state encoded value. I think the countries.geojson file already includes this information.

If this is not sufficient you can have a look into e.g. StateParser on how to implement this:

  1. create an encoded value like my_area (enum or integer)
  2. in MyAreaParser use the list from way.getTag(“custom_areas”, emptyList()) to decide which enum/integer
  3. include the encoded value and parser in DefaultImportRegistry
  4. set custom_areas.directory to specify your custom areas. This ensures that areaIndex is populated, which is then used in OSMReader.setArtificialWayTags to set the “custom_areas” list for every coordinate.
  5. Once the encoded value is filled you can use it via path details.

Thanks you again for your response.
i’m guessing you are referring to this file for the state parser.
I was hoping that it would only involve the configuration and parsing of the response (as adding the custom_areas) - not requiring to re-compile the code.
i’ll need to rethink my approach.

This one.

not requiring to re-compile the code.

Unfortunately this is required at the moment, I think.