Advanced

Change History

New api methods will be announced here. Changes in our data that is relevant to checkers scripts/tags will also be announced here.

Message: Re: IMPORTANT new polygon data

Changed By: magma1447
Change Date: May 22, 2021 12:49AM

Re: IMPORTANT new polygon data
I bet all those script depends on the now defunct GetSimplifiedRegionPolygons() and GetSimplifiedCountyPolygons().

Since the scripts don't need the polygons themselves (I think and hope) there is no sense to passing the whole polygon via the scripts. Not the least now when there are higher precision in the polygons. Project-GC don't have any "simplified" anymore either. Therefore I have a new idea of approach.

First, three new methods implemented:
[list]
[*] GetRegionNamesInPolygonInfoFromCountry(country)
[*] GetCountyNamesInPolygonInfoFromCountry(country)
[*] GetCountyNamesInPolygonInfoFromRegion(country, region)
[/list]

All three functions returns an object looking like this:
{ id: "text-numeric", "name": "text-name", "minLat": float, "maxLat": float, "minLon": float, "maxLon": float }

Use the returned map variable exactly as before, but instead of providing polygon data, just add the [b]id[/b] that these functions returns. Proof of concept is written here:
[url=https://project-gc.com/Tools/Challenges?edit&tagId=60934]https://project-gc.com/Tools/Challenges?edit&tagId=60934[/url]

This should be much more lightweight and efficient. The downside is that some scripts needs to be adjusted. I honestly don't feel to comfortable with LUA since I touch it like once per year. But if there is a script owned by someone who isn't active, I can update it if someone provides me new source code. Alternatively I can also move tags from one script to another (updated version of the original).

Consider this beta in the way that I might update the functions in different ways depending on feedback here. Besides that they should work, it's a fairly simple approach. I will release these callbacks in a few minutes. Any feedback and thoughts is welcome. If something is being done today that isn't possible anymore, please tell me about it.

Original Message

Author: magma1447
Date: May 21, 2021 11:54PM

Re: IMPORTANT new polygon data
I bet all those script depends on the now defunct GetSimplifiedRegionPolygons() and GetSimplifiedCountyPolygons().

Since the scripts don't need the polygons themselves (I think and hope) there is no sense to passing the whole polygon via the scripts. Not the least now when there are higher precision in the polygons. Project-GC don't have any "simplified" anymore either. Therefore I have a new idea of approach.

First, three new methods implemented:
[list]
[*] GetRegionNamesInCountry(country)
[*] GetCountyNamesInCountry(country)
[*] GetCountyNamesInRegion(country, region)
[/list]

All three functions returns an object looking like this:
{ id: "text-numeric", "name": "text-name", "minLat": float, "maxLat": float, "minLon": float, "maxLon": float }

Use the returned map variable exactly as before, but instead of providing polygon data, just add the [b]id[/b] that these functions returns. Proof of concept is written here:
[url=https://project-gc.com/Tools/Challenges?edit&tagId=60934]https://project-gc.com/Tools/Challenges?edit&tagId=60934[/url]

This should be much more lightweight and efficient. The downside is that some scripts needs to be adjusted. I honestly don't feel to comfortable with LUA since I touch it like once per year. But if there is a script owned by someone who isn't active, I can update it if someone provides me new source code. Alternatively I can also move tags from one script to another (updated version of the original).

Consider this beta in the way that I might update the functions in different ways depending on feedback here. Besides that they should work, it's a fairly simple approach. I will release these callbacks in a few minutes. Any feedback and thoughts is welcome. If something is being done today that isn't possible anymore, please tell me about it.