Skip to content

Commit 3534601

Browse files
authored
Merge pull request #387 from okfn/active-only
only show active portals on map
2 parents d6dd33b + c696258 commit 3534601

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

data/datapackage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"title": "status",
133133
"type": "string",
134134
"constraints": {
135-
"pattern": "active|inactive|static"
135+
"enum": ["active", "inactive", "static"]
136136
},
137137
"description": "This indicates whether the portal is currently available (active) or offline (inactive)"
138138
},

data/portals.csv

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ayuntamiento-de-malaga,Portal Datos Abiertos Ayuntamiento de Málaga,https://dat
4848
ayuntamiento-de-santander,Santander datos abiertos,https://datos.santander.es/,Ayuntamiento de Santander,Ayuntamiento de Santander,,Government,Santander datos abiertos,city spain,,,,Santander,"43.4628, 3.8050",ES,es,active,,,,,
4949
badalona_cat,Badalona Open Data,https://badalona.cat/portalWeb/badalona.portal?_nfpb=true&_pageLabel=opendata,,,,,Badalona Open Data Catalog,ctic level.local eu-official spain,cc-by,,,Badalona,"41.4497809,2.2482551",ES,ca,active,2011-06-27T18:12:38.942Z,,,,
5050
bahrain,Open Data Platform of the Kingdom of Bahrain,https://www.bahrain.bh/wps/portal/data/,,,,,Replaced by https://www.data.gov.bh. The open Data Platform is an important initiative for the Kingdom of Bahrain as it aims to implement a public data hub and a strategy for open data to enable transparency and promote eParticipation.,ctic,,,,Bahrain,"26.1551249,50.5344606",BH,ar,inactive,2011-06-27T18:15:04.926Z,,,,
51-
bahrain-open-data,Bahrain Open Data,https://www.data.gov.bh/,Ariffin Abdul Latiff,Central Informatics Organisation,01/10/2013,Government,Open data portal for the Government of Bahrain,,Other (Open),https://www.data.gov.bh/en/TermsOfUse,,Bahrain,"25.9434256,50.6014985",BH,,inactive,,,,,
51+
bahrain-open-data,Bahrain Open Data Portal,https://www.data.gov.bh/,Ariffin Abdul Latiff,Information & eGovernment Authority,01/10/2013,Government,Open data portal for the Government of Bahrain,,Other (Open),https://www.data.gov.bh/en/TermsOfUse,,Bahrain,"25.9434256,50.6014985",BH,,active,,,,,
5252
banffopendata_ca,"Banff, Alberta",https://maps.banff.ca/opendata/,Town of Banff,Town of Banff,,,"Open Data is Town of Banff datasets freely accessible in machine-readable formats with no restrictions in licensing or copyright.
5353

5454
[License](https://www.banffopendata.ca/Home/About) based based on the UK Government's Open Government Licence for Public Sector Information and the BC Government's Open Government Licence for Government of BC Information and the City of Toronto's Open Data Licence and has been adapted for the Town of Banff.
@@ -700,6 +700,8 @@ puglia,Puglia Data Portal,https://www.dati.puglia.it/,Puglia regional government
700700
qc,Québec,https://data.gouv.qc.ca/,Province de Québec,Province de Québec,,,You may [send feedback](https://data.gouv.qc.ca/?node=/nous-joindre) and [request datasets](https://data.gouv.qc.ca/?node=/demande-donnees) via webform. Uses its [own license](https://data.gouv.qc.ca/?node=/licence).,level.local canada,other-at,,,Québec,"54,-72",CA,fr,active,2012-08-27T13:59:41.439Z,,,,
701701
qspatial-qld,Queensland Spatial Catalogue - QSpatial,https://qldspatial.information.qld.gov.au/,Stephen Gates,Queensland Government ,27/08/2015,Government,"This service is a Queensland Government initiative to provide improved public access to a variety of spatial and associated data. You can discover, display, select and download or order data over an area of interest in selected formats, including map coverage data, image data and text file data.",queensland,Creative Commons - Attribution,https://creativecommons.org/licenses/by/3.0/au/,,"Queensland, Australia","-21.9182856,144.45",AU,en,active,,Esri GeoPortal,,,
702702
qualicum_beach_bc,"Qualicum Beach, British Columbia",https://data.civicinfo.ca/organization/qualicum-beach-town,Town of Qualicum Beach,Town of Qualicum Beach,,,,canada,,,,"Qualicum Beach, British Columbia","49.3479776,-124.4439377",CA,en,active,2014-08-09T22:44:58.889Z,,,,
703+
qatar,Qatar Open Data Portal,https://www.data.gov.qa/,Government of Qatar,Government of Qatar,10/05/2020,Government,"A national hub for open data, insights, and interactive tools. Access and explore government data,
704+
visualizations, and APIs to Drive innovation and informed decisions.",,,https://www.data.gov.qa/pages/license/annexes,,Qatar,"25.3271054,51.1966577",QA,"en, ar",active,2025-07-09T04:01:29Z,,,,
703705
quebec_qc_ca,"Québec, Québec",https://donnees.ville.quebec.qc.ca/,Ville de Québec,Ville de Québec,,,You may send feedback via [email]([email protected]) or [webform](https://donnees.ville.quebec.qc.ca/nousjoindre.aspx). Uses its [own license](https://donnees.ville.quebec.qc.ca/licence.aspx).,canada,,,,"Québec, Québec","46.8257374,-71.2349114",CA,fr,active,2012-02-28T20:18:54.643Z,,,,
704706
rcongo_opendataforafrica,Open Data for Republic of Congo,https://rcongo.opendataforafrica.org/,African Development Bank Group,African Development Bank Group,,,Open data portal for Republic of Congo,africa,other-at,,,Republic of Congo,"-0.7264327,15.6419155",cog,en,active,2013-08-29T08:04:48.393Z,,,,
705707
recife-city-open-data,Recife City Open Data,https://dados.recife.pe.gov.br,Breno Alenca,EMPREL - Empresa Municipal de Informática,15/07/2013,Government,"The Open Data Portal Recife, developed by EMPREL - Company municipal technology, aims to provide public and easily access and search data generated by government departments and agencies of municipal management. The publication of the data in an open format allows anyone can develop applications or views, seeking to facilitate data analysis, promoting the improvement of services through innovation and creativity, and contributing to greater involvement of society by the municipal government.",,Open Data Commons - Attribution Share-alike (Open Database License),,"licenses are explicit in each resource, eg https://dados.recife.pe.gov.br/dataset/acidentes-de-transito-com-vitimas-2014","Recife, Pernambuco","-8.0462733,-35.0025289",BR,pt,active,,,,,
@@ -918,4 +920,4 @@ open-data-nepal,Open Data Nepal,https://opendatanepal.com/,Open Knowledge Nepal,
918920
stat-tj,Agency on Statistics under President of the Republic of Tajikistan,https://www.stat.tj/en,The Statistical Agency under President of the Republic of Tajikistan,The Statistical Agency under President of the Republic of Tajikistan,,Government,"The information in the Statistical Agency is prepared according to the program of statistical works and Publication catalogue. The main publication of the Statistical Agency is the monthly report Socio-Economic Situation that includes the latest monthly data with brief commentary and is circulated to the offices of the President, Prime Minister and ministries and departments. This publication is available to the public. The report is published by the 12th day of the month following the accounting period. The annual publications also are issued: Statistical Yearbook of Tajikistan, Regions of Tajikistan, Tajikistan in figures and thematic publications.",tajikistan statistics,Other (Not Open),,"When using materials published on this site, a link to www.stat.tj is required.",Tajikistan,"38.5754817,68.7900625",TJ,en,active,2022-07-17T16:49:49,,,,
919921
dadosjusbr,DadosJusBR,https://dadosjusbr.org/,Instituto Federal de Alagoas (IFAL) in partnership with Transparência Brasil (TB) and Universidade Federal de Campina Grande (UFCG),Instituto Federal de Alagoas,2018-12-31,Community,"The portal consumes or scrapes data from several organizations of the Brazilian judiciary and public prosecution offices and reworks them using a common schema, making them easier to use for everyone and possible to compare to each other.",brazil judiciary,cc-by,,https://creativecommons.org/licenses/by/4.0/,Brazil,"15.74706, -47.89593",BR,pt,active,2022-07-24T22:38:06Z,Custom/in-house implementation,https://api.dadosjusbr.org/,Custom/in-house implementation,
920922
bratislava-opendata,Bratislava Open Data Portal,https://opendata.bratislava.sk,Magistrát hlavného mesta Slovenskej republiky Bratislavy,The city of Bratislava,,Government,Open data is information or data that is freely and freely available to everyone under the same conditions and can be used for any purpose; commercial or non-commercial. It is made available on the Internet in a structured form that allows it to be processed in bulk by machines. The portal 'www.opendata.bratislava.sk' serves to promote the open data of the City of Bratislava.,bratislava slovakia,,,,"Bratislava, Slovakia","48.14409, 17.10971",SK,sk,active,2023-05-04T14:22:56Z,Custom/in-house implementation,https://opendata.bratislava.sk/api,Custom/in-house implementation,
921-
cz-prague-geoportal,Geoportal of the city of Prague,https://www.geoportalpraha.cz/,Institut plánování a rozvoje hl. m. Prahy,The city of Prague,,Government,"Prague geographic data, metadata search, opendata portal.",czech czechia prague geoportal praha,,https://www.geoportalpraha.cz/cs/licencni-podminky-pro-otevrena-data,,"Prague, Czechia","50.0731375, 14.4176119",CZ,cs,active,2023-05-16T14:13:00Z,Custom/in-house implementation,,,http://opendata.iprpraha.cz/feed.xml
923+
cz-prague-geoportal,Geoportal of the city of Prague,https://www.geoportalpraha.cz/,Institut plánování a rozvoje hl. m. Prahy,The city of Prague,,Government,"Prague geographic data, metadata search, opendata portal.",czech czechia prague geoportal praha,,https://www.geoportalpraha.cz/cs/licencni-podminky-pro-otevrena-data,,"Prague, Czechia","50.0731375, 14.4176119",CZ,cs,active,2023-05-16T14:13:00Z,Custom/in-house implementation,,,http://opendata.iprpraha.cz/feed.xml

public/js/app.js

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,27 @@ const createOverviewMap = (dataset) => {
2727
});
2828
};
2929

30+
const includePortalOnMap = (portal) =>
31+
portal.status === "active" && !!portal.location;
32+
33+
const portalToGeoJSON = (portal) => {
34+
const coordinates = portal.location.split(",");
35+
const lat = parseFloat(coordinates[0]);
36+
const lng = parseFloat(coordinates[1]);
37+
38+
return {
39+
type: "Feature",
40+
geometry: {
41+
type: "Point",
42+
coordinates: [lng, lat],
43+
},
44+
properties: portal,
45+
};
46+
};
47+
3048
const createGeoJSONFeatures = (dataset) => {
31-
const portals = Object.values(dataset).filter((portal) => portal.location);
32-
return portals.map((portal) => {
33-
const coordinates = portal.location.split(",");
34-
const lat = parseFloat(coordinates[0]);
35-
const lng = parseFloat(coordinates[1]);
36-
37-
return {
38-
type: "Feature",
39-
geometry: {
40-
type: "Point",
41-
coordinates: [lng, lat],
42-
},
43-
properties: portal,
44-
};
45-
});
49+
const portals = Object.values(dataset).filter(includePortalOnMap);
50+
return portals.map(portalToGeoJSON);
4651
};
4752

4853
const addMapLayers = (map, features) => {
@@ -146,7 +151,7 @@ const setupPointClickHandler = (map) => {
146151
map.on("click", "unclustered-point", (e) => {
147152
const feature = e.features[0];
148153
const coordinates = feature.geometry.coordinates.slice();
149-
const { id, title, description_html, url } = feature.properties;
154+
const { name, title, description_html, url } = feature.properties;
150155

151156
// Ensure that if the map is zoomed out such that
152157
// multiple copies of the feature are visible, the
@@ -159,7 +164,7 @@ const setupPointClickHandler = (map) => {
159164
.setLngLat(coordinates)
160165
.setHTML(
161166
`<p>
162-
<a href="portal/${id}">${title}</a>
167+
<a href="portal/${name}">${title}</a>
163168
</p>
164169
${description_html}
165170
<p>

0 commit comments

Comments
 (0)