Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some datasets have a footprintWKT instead of latitude/longitude #7

Open
nicokant opened this issue Dec 4, 2023 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@nicokant
Copy link
Collaborator

nicokant commented Dec 4, 2023

example dataset: https://ipt.nina.no/resource?r=myrdata_historisk

@nicokant nicokant self-assigned this Dec 4, 2023
@nicokant
Copy link
Collaborator Author

nicokant commented Dec 20, 2023

There are still problems with this dataset and pygeoapi

Pygeoapi provider OGR

{
                "type": "feature",
                "default": true,
                "name": "OGR",
                "editable": false,
                "id_field": "id",
                "layer": "data",
                "data": {
                    "source_type": "VRT",
                    "source": "/vsicurl/http://localhost:8000/datasets/72d7f10f-8c52-4714-95e8-8d66f3ac3e2c/definition.vrt"
                }
            }

definition.vrt

<OGRVRTDataSource>
    <OGRVRTLayer name="data">
      <SrcDataSource><![CDATA[
        <OGRVRTDataSource>
          <OGRVRTLayer name="event">
            <SrcDataSource>CSV:/vsizip/{/vsicurl/https://ipt.nina.no/archive.do?r=myrdata_historisk}/event.txt</SrcDataSource>
            <LayerSRS>WGS84</LayerSRS>
          </OGRVRTLayer>
          <OGRVRTLayer name="measurementorfact">
              <SrcDataSource>CSV:/vsizip/{/vsicurl/https://ipt.nina.no/archive.do?r=myrdata_historisk}/measurementorfact.txt</SrcDataSource>
              <LayerSRS>WGS84</LayerSRS>
            </OGRVRTLayer>
        </OGRVRTDataSource>]]>
      </SrcDataSource>
      <SrcSQL>select * from event join measurementorfact on measurementorfact.id=event.id</SrcSQL>
      
      <GeometryField encoding="WKT" field="footprintWKT" reportSrcColumn="false">
        <SRS>WGS84</SRS>
      </GeometryField>
      
      <LayerSRS>WGS84</LayerSRS>
    </OGRVRTLayer>
  </OGRVRTDataSource>

The VRT seems to work fine both with ogrinfo and ogr2ogr, but when using with pygeoapi it returns the following error:

metadata_catalogue-django-dev-1  | ERROR 2023-12-20 13:39:26,082 ogr 145 139993141466880 'NoneType' object has no attribute 'AssignSpatialReference'
metadata_catalogue-django-dev-1  | ERROR 2023-12-20 13:39:26,083 api 145 139993141466880 'NoneType' object has no attribute 'AssignSpatialReference'
metadata_catalogue-django-dev-1  | ERROR 2023-12-20 13:39:26,083 api 145 139993141466880 generic error (check logs)

nicokant added a commit that referenced this issue Dec 20, 2023
@frafra frafra added the bug Something isn't working label Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants