diff --git a/docs/history/changelog.md b/docs/history/changelog.md index fbfa453..8848475 100644 --- a/docs/history/changelog.md +++ b/docs/history/changelog.md @@ -38,9 +38,9 @@ Iterative improvements are made outside of the release cycle. They do not involv ### Normative documentation -- [#262](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/262) - Use well-known text to represent geometries in the CSV publication format. +- [#262](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/262), [#276](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/276) - Use well-known text to represent geometries in the CSV publication format. - [#260](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/260) - Use relative links to jsonschema anchors. -- [#266](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/266) - Add `featureType` field to GeoJSON publication format. +- [#266](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/266), [#276](https://github.com/Open-Telecoms-Data/open-fibre-data-standard/pull/276) - Add `featureType` field to GeoJSON publication format. ### Non-normative documentation diff --git a/examples/csv/spans.csv b/examples/csv/spans.csv index d43acef..775199f 100644 --- a/examples/csv/spans.csv +++ b/examples/csv/spans.csv @@ -1,2 +1,2 @@ id,spans/0/id,spans/0/name,spans/0/phase/id,spans/0/phase/name,spans/0/status,spans/0/readyForServiceDate,spans/0/start,spans/0/end,spans/0/directed,spans/0/route,spans/0/physicalInfrastructureProvider/id,spans/0/physicalInfrastructureProvider/name,spans/0/supplier/id,spans/0/supplier/name,spans/0/transmissionMedium,spans/0/deployment,spans/0/deploymentDetails/description,spans/0/darkFibre,spans/0/fibreType,spans/0/fibreTypeDetails/fibreSubtype,spans/0/fibreTypeDetails/description,spans/0/fibreCount,spans/0/fibreLength,spans/0/technologies,spans/0/capacity,spans/0/capacityDetails/description,spans/0/countries -a096d627-72e1-4f9b-b129-951b1737bff4,1,Accra to Kumasi,1,NextGen Phase 1,operational,2018-01-01,1,2,False,"LINESTRING (-0.173 5.626,-0.178 5.807,-0.112 5.971,-0.211 5.963,-0.321 6.17,-0.488 6.29,-0.56 6.421,-0.752 6.533,-0.867 6.607,-1.101 6.585,-1.304 6.623,-1.461 6.727,-1.628 6.713)",GH-RGD-CS111111111,FibreCo,GH-RGD-CS333333333,ProjectCo,fibre,belowGround,Buried in ducts,True,G.652,G.652.D,"CABLED STANDARD ENHANCED SINGLEMODE FIBRE ESMF, LOW WATER PEAK SINGLE MODE FIBRE G.652.D, OS2",24,276000,sdh,4.976,2xSTM-16,GH +a096d627-72e1-4f9b-b129-951b1737bff4,1,Accra to Kumasi,1,NextGen Phase 1,operational,2018-01-01,1,2,False,"LINESTRING (-0.173 5.626, -0.178 5.807, -0.112 5.971, -0.211 5.963, -0.321 6.17, -0.488 6.29, -0.56 6.421, -0.752 6.533, -0.867 6.607, -1.101 6.585, -1.304 6.623, -1.461 6.727, -1.628 6.713)",GH-RGD-CS111111111,FibreCo,GH-RGD-CS333333333,ProjectCo,fibre,belowGround,Buried in ducts,True,G.652,G.652.D,"CABLED STANDARD ENHANCED SINGLEMODE FIBRE ESMF, LOW WATER PEAK SINGLE MODE FIBRE G.652.D, OS2",24,276000,sdh,4.976,2xSTM-16,GH diff --git a/examples/geojson/nodes.geojson b/examples/geojson/nodes.geojson index 5d1597f..3fe3cd5 100644 --- a/examples/geojson/nodes.geojson +++ b/examples/geojson/nodes.geojson @@ -73,7 +73,20 @@ "networkProviders": [ { "id": "GH-RGD-CS222222222", - "name": "FastWeb" + "name": "FastWeb", + "identifier": { + "id": "CS222222222", + "scheme": "GH-RGD", + "legalName": "FastWeb Ghana Limited", + "uri": "https://example.com/companies/CS222222222" + }, + "country": "GH", + "roles": [ + "networkProvider" + ], + "roleDetails": "FastWeb provides wholesale services to service providers and dark fibre access to other network providers.", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" } ], "network": { @@ -215,7 +228,20 @@ "networkProviders": [ { "id": "GH-RGD-CS222222222", - "name": "FastWeb" + "name": "FastWeb", + "identifier": { + "id": "CS222222222", + "scheme": "GH-RGD", + "legalName": "FastWeb Ghana Limited", + "uri": "https://example.com/companies/CS222222222" + }, + "country": "GH", + "roles": [ + "networkProvider" + ], + "roleDetails": "FastWeb provides wholesale services to service providers and dark fibre access to other network providers.", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" } ], "network": { diff --git a/examples/geojson/spans.geojson b/examples/geojson/spans.geojson index f88a50f..10edd9d 100644 --- a/examples/geojson/spans.geojson +++ b/examples/geojson/spans.geojson @@ -192,7 +192,20 @@ "networkProviders": [ { "id": "GH-RGD-CS222222222", - "name": "FastWeb" + "name": "FastWeb", + "identifier": { + "id": "CS222222222", + "scheme": "GH-RGD", + "legalName": "FastWeb Ghana Limited", + "uri": "https://example.com/companies/CS222222222" + }, + "country": "GH", + "roles": [ + "networkProvider" + ], + "roleDetails": "FastWeb provides wholesale services to service providers and dark fibre access to other network providers.", + "website": "https://www.example.com", + "logo": "https://www.example.com/logo.png" } ], "supplier": { diff --git a/manage.py b/manage.py index e6d907c..94892f9 100755 --- a/manage.py +++ b/manage.py @@ -540,6 +540,7 @@ def pre_commit(): truncation_length=9, root_list_path='networks', line_terminator='LF', + convert_wkt=True ) # Update examples/csv/template @@ -551,37 +552,9 @@ def pre_commit(): truncation_length=9, no_deprecated_fields=True, line_terminator='LF', + convert_wkt=True ) - # Use WKT geometry in CSV examples and templates. This code should be removed once Flatten Tool supports WKT - replacements = { - 'examples/csv/nodes.csv': [ - ('nodes/0/location/type,nodes/0/location/coordinates','nodes/0/location'), - ('Point,-0.174;5.625', 'POINT (-0.174 5.625)'), - ('Point,-1.628;6.711', 'POINT (-1.628 6.711)') - ], - 'examples/csv/template/nodes.csv': [ - ('nodes/0/location/type,nodes/0/location/coordinates','nodes/0/location') - ], - 'examples/csv/spans.csv': [ - ('spans/0/route/type,spans/0/route/coordinates','spans/0/route'), - ('LineString,"-0.173,5.626;-0.178,5.807;-0.112,5.971;-0.211,5.963;-0.321,6.17;-0.488,6.29;-0.56,6.421;-0.752,6.533;-0.867,6.607;-1.101,6.585;-1.304,6.623;-1.461,6.727;-1.628,6.713"', '"LINESTRING (-0.173 5.626,-0.178 5.807,-0.112 5.971,-0.211 5.963,-0.321 6.17,-0.488 6.29,-0.56 6.421,-0.752 6.533,-0.867 6.607,-1.101 6.585,-1.304 6.623,-1.461 6.727,-1.628 6.713)"') - ], - 'examples/csv/template/spans.csv': [ - ('spans/0/route/type,spans/0/route/coordinates','spans/0/route') - ] - } - - for key, value in replacements.items(): - with open(key, 'r') as f: - content = f.read() - - for replacement in value: - content = content.replace(replacement[0], replacement[1]) - - with open(key, 'w') as f: - f.write(content) - # Update docs/reference/publication_formats/csv.md update_csv_docs(jsonref_schema) @@ -594,22 +567,6 @@ def pre_commit(): # Update examples/geojson/nodes.geojson and examples/geojson/spans.geojson subprocess.run(['libcoveofds', 'jsontogeojson', 'examples/json/network-package.json', 'examples/geojson/nodes.geojson', 'examples/geojson/spans.geojson']) - # Add `properties.featureType` field to GeoJSON examples. This code should be removed once libcoveofds supports this feature. - feature_collections = { - 'examples/geojson/nodes.geojson': 'node', - 'examples/geojson/spans.geojson': 'span' - } - - for path, feature_type in feature_collections.items(): - with open(path, 'r') as f: - feature_collection = json.load(f) - - for feature in feature_collection['features']: - feature['properties']['featureType'] = feature_type - - with open(path, 'w') as f: - json.dump(feature_collection, f, indent=4) - # Run mdformat subprocess.run(['mdformat', 'docs']) diff --git a/requirements.in b/requirements.in index 631e074..7a4b3f7 100644 --- a/requirements.in +++ b/requirements.in @@ -11,8 +11,8 @@ pyairtable PyGithub ocdskit>=1.1.3 sphinx-design -libcoveofds -flattentool>=0.20 +libcoveofds>=0.8.2 +flattentool>=0.22 pytest jscc mdformat diff --git a/requirements.txt b/requirements.txt index 3ce25e6..c670b67 100644 --- a/requirements.txt +++ b/requirements.txt @@ -52,8 +52,10 @@ docutils==0.17.1 # sphinxcontrib-opendataservices-jsonschema et-xmlfile==1.1.0 # via openpyxl -flattentool==0.20.0 +flattentool==0.22.0 # via -r requirements.in +geojson==3.0.1 + # via flattentool idna==3.3 # via requests ijson==3.1.4 @@ -85,7 +87,6 @@ jsonref==1.0.1 # -r requirements.in # flattentool # jscc - # libcoveofds # ocdsextensionregistry # ocdskit # ocdsmerge @@ -95,7 +96,7 @@ jsonschema==4.17.3 # -r requirements.in # jscc # libcoveofds -libcoveofds==0.5.0 +libcoveofds==0.8.2 # via -r requirements.in livereload==2.6.3 # via sphinx-autobuild @@ -120,6 +121,8 @@ myst-parser==0.18.0 # sphinxcontrib-opencontracting # sphinxcontrib-opendataservices # sphinxcontrib-opendataservices-jsonschema +numpy==1.25.0 + # via shapely ocdsextensionregistry==0.1.13 # via # ocdskit @@ -169,7 +172,6 @@ pyyaml==6.0 requests==2.28.1 # via # jscc - # libcoveofds # ocdsextensionregistry # ocdsmerge # pyairtable @@ -183,8 +185,12 @@ rfc3339-validator==0.1.4 # via jscc rfc3986-validator==0.1.1 # via jscc +rfc3987==1.3.8 + # via libcoveofds schema==0.7.5 # via flattentool +shapely==2.0.1 + # via flattentool six==1.16.0 # via # livereload