2025-03-02     2025-03-03     2025-03-04

the lat/lng for adm1 should be within geoname-shape for country.

number of errors=0
number of warnings=0
Group=chkGrpLocation
Group=chkGrpShp

select geoname.name,geoname.geonameid,geoname.countrycode,geoname.admincode1,coalesce(geoname_shape.countrycode,'xx'), 'http://map.immofacts.ch/servlet/geonames?srv=781&lat=' || GEONAME.longlat[1] || '&lng=' || GEONAME.longlat[0] as shape from geoname join geoname_shape on level=1 and st_within(st_GeomFromText('Point(' || longlat[0] || ' ' || longlat[1] || ')',4326),wkb_geometry) where featurecode='ADM1' and geoname.countrycode<>geoname_shape.countrycode and coalesce(geoname.cc2) <> geoname_shape.countrycode order by geoname.countrycode,geoname.admincode1

name	geonameid	countrycode	admincode1	coalesce	shape