I'm building map viewer using d3js and data from WFS service.
In Poland we have 3 levels of administrative divisions:
- province
- district
- community
Using WFS service I can get exact boundaries of each level.
For example for provinces I'm using http://sdi.geoportal.gov.pl/wfs_prg/wfservice.aspx?request=getFeature&version=1.1.0&service=WFS&typename=gmgml:WOJEWODZTWA
For districts: http://sdi.geoportal.gov.pl/wfs_prg/wfservice.aspx?request=getFeature&version=1.1.0&service=WFS&typename=gmgml:POWIATY
Then using ogr2ogr I'm converting those GML files to TopoJSON and displaying using d3js. This part works fine.
Right now I need to know which district belongs to which province, but unfortunately this isn't available in file that comes from WFS.
I need this to be able to filter my map by provinces - display only districts for specific provinces.
I know that I can open SHP that file in QGIS and add attribute for every district, but I would have to add this to 2000+ items (before that checking manually if that district belongs to that province), and I would like to avoid that extra work.
Can this be done automatically? Using some kind of software?
I have only tiny experience with QGIS so I didn't found that option.
i imagine is as checking if calculated center point o district belongs to province boundaries, but maybe this is simpler task?