connormanning / entwine

Entwine - point cloud organization for massive datasets
https://entwine.io
Other
445 stars 129 forks source link

Offset is not respected by build #215

Closed vvmruder closed 5 years ago

vvmruder commented 5 years ago

Using pdal 2.0.1 and entwine 2.1.0 to produce EPT out of LAZ file I run into the problem that my offset is not recognized by the entwine build.

The output of pdal info --metadata delivers:

{
  "filename": "ch.bl.bksd.sfm_21_026_eptingen_witwald.laz/21_026_Eptingen_Witwald.laz",
  "metadata":
  {
    "comp_spatialreference": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]",
    "compressed": true,
    "count": 64173422,
    "creation_doy": 258,
    "creation_year": 2019,
    "dataformat_id": 3,
    "dataoffset": 675,
    "filesource_id": 0,
    "global_encoding": 0,
    "global_encoding_base64": "AAA=",
    "header_size": 227,
    "major_version": 1,
    "maxx": 8780.48,
    "maxy": 9130.15,
    "maxz": 690.45,
    "minor_version": 2,
    "minx": 8749.84,
    "miny": 9102.96,
    "minz": 677.69,
    "offset_x": 2620000,
    "offset_y": 1240000,
    "offset_z": 0,
    "point_length": 34,
    "project_id": "00000000-0000-0000-0000-000000000000",
    "scale_x": 0.01,
    "scale_y": 0.01,
    "scale_z": 0.01,
    "software_id": "PDAL 2.0.1 (369303)",
    "spatialreference": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]",
    "srs":
    {
      "compoundwkt": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]",
      "horizontal": "PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]]",
      "isgeocentric": false,
      "isgeographic": false,
      "prettycompoundwkt": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",\n    PROJCS[\"CH1903+ / LV95\",\n        GEOGCS[\"CH1903+\",\n            DATUM[\"CH1903+\",\n                SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,\n                    AUTHORITY[\"EPSG\",\"7004\"]],\n                TOWGS84[674.374,15.056,405.346,0,0,0,0],\n                AUTHORITY[\"EPSG\",\"6150\"]],\n            PRIMEM[\"Greenwich\",0,\n                AUTHORITY[\"EPSG\",\"8901\"]],\n            UNIT[\"degree\",0.0174532925199433,\n                AUTHORITY[\"EPSG\",\"9122\"]],\n            AUTHORITY[\"EPSG\",\"4150\"]],\n        PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],\n        PARAMETER[\"latitude_of_center\",46.9524055555556],\n        PARAMETER[\"longitude_of_center\",7.43958333333333],\n        PARAMETER[\"azimuth\",90],\n        PARAMETER[\"rectified_grid_angle\",90],\n        PARAMETER[\"scale_factor\",1],\n        PARAMETER[\"false_easting\",2600000],\n        PARAMETER[\"false_northing\",1200000],\n        UNIT[\"metre\",1,\n            AUTHORITY[\"EPSG\",\"9001\"]],\n        AXIS[\"Easting\",EAST],\n        AXIS[\"Northing\",NORTH],\n        AUTHORITY[\"EPSG\",\"2056\"]],\n    VERT_CS[\"LHN95 height\",\n        VERT_DATUM[\"Landeshohennetz 1995\",2005,\n            AUTHORITY[\"EPSG\",\"5128\"]],\n        UNIT[\"metre\",1,\n            AUTHORITY[\"EPSG\",\"9001\"]],\n        AXIS[\"Gravity-related height\",UP],\n        AUTHORITY[\"EPSG\",\"5729\"]]]",
      "prettywkt": "PROJCS[\"CH1903+ / LV95\",\n    GEOGCS[\"CH1903+\",\n        DATUM[\"CH1903+\",\n            SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,\n                AUTHORITY[\"EPSG\",\"7004\"]],\n            TOWGS84[674.374,15.056,405.346,0,0,0,0],\n            AUTHORITY[\"EPSG\",\"6150\"]],\n        PRIMEM[\"Greenwich\",0,\n            AUTHORITY[\"EPSG\",\"8901\"]],\n        UNIT[\"degree\",0.0174532925199433,\n            AUTHORITY[\"EPSG\",\"9122\"]],\n        AUTHORITY[\"EPSG\",\"4150\"]],\n    PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],\n    PARAMETER[\"latitude_of_center\",46.9524055555556],\n    PARAMETER[\"longitude_of_center\",7.43958333333333],\n    PARAMETER[\"azimuth\",90],\n    PARAMETER[\"rectified_grid_angle\",90],\n    PARAMETER[\"scale_factor\",1],\n    PARAMETER[\"false_easting\",2600000],\n    PARAMETER[\"false_northing\",1200000],\n    UNIT[\"metre\",1,\n        AUTHORITY[\"EPSG\",\"9001\"]],\n    AXIS[\"Easting\",EAST],\n    AXIS[\"Northing\",NORTH],\n    AUTHORITY[\"EPSG\",\"2056\"]]",
      "proj4": "+proj=somerc +lat_0=46.9524055555556 +lon_0=7.43958333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +vunits=m +no_defs",
      "units":
      {
        "horizontal": "metre",
        "vertical": "metre"
      },
      "vertical": "VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]",
      "wkt": "PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]]"
    },
    "system_id": "PDAL",
    "vlr_0":
    {
      "data": "AQABAAAADAAABAAAAQABAAEEAAABAAEAAgSxhx4AAAABCLGHCAAeAAYIAAABAI4jDgiwhwMAAAAADAAAAQAICAQMAAABACkjABAAAAEAYRYBELGHDQAmAAIQAAABAAgUAxAAAAEAKSM=",
      "description": "GeoTiff GeoKeyDirectoryTag",
      "record_id": 34735,
      "user_id": "LASF_Projection"
    },
    "vlr_1":
    {
      "data": "okW28/0ShUDpJjEIrBwuQKjGSzeJVXlA",
      "description": "GeoTiff GeoDoubleParamsTag",
      "record_id": 34736,
      "user_id": "LASF_Projection"
    },
    "vlr_2":
    {
      "data": "Q0gxOTAzKyAvIExWOTUgKyBMSE45NSBoZWlnaHR8Q0gxOTAzK3xMSE45NSBoZWlnaHR8AA==",
      "description": "GeoTiff GeoAsciiParamsTag",
      "record_id": 34737,
      "user_id": "LASF_Projection"
    },
    "vlr_3":
    {
      "data": "AgAAAAMEAQAAAAAAUMMAAP////////////////////8DAAYAFAACAAcACAACAAgABgACAA==",
      "description": "http://laszip.org",
      "record_id": 22204,
      "user_id": "laszip encoded"
    }
  },
  "pdal_version": "2.0.1 (git-version: 369303)"
}

The resulting ept.json looks like:

{
  "bounds": [
    8748.0,
    9100.0,
    667.0,
    8782.0,
    9134.0,
    701.0
  ],
  "boundsConforming": [
    8749.0,
    9102.0,
    677.0,
    8781.0,
    9131.0,
    691.0
  ],
  "dataType": "laszip",
  "hierarchyType": "json",
  "points": 64173422,
  "schema": [
    {
      "name": "X",
      "offset": 8765.0,
      "scale": 0.01,
      "size": 4,
      "type": "signed"
    },
    {
      "name": "Y",
      "offset": 9117.0,
      "scale": 0.01,
      "size": 4,
      "type": "signed"
    },
    {
      "name": "Z",
      "offset": 684.0,
      "scale": 0.01,
      "size": 4,
      "type": "signed"
    },
    {
      "name": "Intensity",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "ReturnNumber",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "NumberOfReturns",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "ScanDirectionFlag",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "EdgeOfFlightLine",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "Classification",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "ScanAngleRank",
      "size": 4,
      "type": "float"
    },
    {
      "name": "UserData",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "PointSourceId",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "GpsTime",
      "size": 8,
      "type": "float"
    },
    {
      "name": "Red",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "Green",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "Blue",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "OriginId",
      "size": 4,
      "type": "unsigned"
    }
  ],
  "span": 128,
  "srs": {
    "authority": "EPSG",
    "horizontal": "2056",
    "wkt": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]"
  },
  "version": "1.0.0"
}

I also used entwine scan to obtain information via entwine. But it's also not recognizing the offset on its own. My understanding is: Entwine will should automatically respect the offset.

Or am I wrong here? Do I need to define it via the schema?

connormanning commented 5 years ago

Entwine determines an offset automatically (see the note here) because it must use a single offset value even for datasets with multiple files with different offsets, and because changing the offset has no effect on the integrity of the data.

What is the use-case where the offset must be preserved in the point data output? Note that in the ept-sources per-file metadata, the original offset of each file is stored as metadata.

As you have already guessed, to achieve this behavior currently, you can use a configuration file (with -c doc) containing a schema key which explicitly sets the scale and offset to your desired values. Adding a --offset flag would be possible, it has just never been requested.

vvmruder commented 5 years ago

Thanks for reply. But I'am still stuck in understanding.

I got this single file dataset with specific offset. PDAL is recognizing it correctly I think. Even if I use entwine scan on it the output stored in ept-source/0.json shows correct offset values for x and y like you can see here (content of this file):

{
  "51_036_Ormalingen_Gaissacker.laz": {
    "bounds": [
      2797.3700000001118,
      8115.469999999972,
      443.65000000000003,
      2804.25,
      8125.619999999879,
      445.5
    ],
    "metadata": {
      "comp_spatialreference": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]",
      "compressed": true,
      "count": 1929125,
      "creation_doy": 258,
      "creation_year": 2019,
      "dataformat_id": 3,
      "dataoffset": 675,
      "filesource_id": 0,
      "global_encoding": 0,
      "global_encoding_base64": "AAA=",
      "header_size": 227,
      "major_version": 1,
      "maxx": 2804.25,
      "maxy": 8125.62,
      "maxz": 445.5,
      "minor_version": 2,
      "minx": 2797.37,
      "miny": 8115.47,
      "minz": 443.65,
      "offset_x": 2630000,
      "offset_y": 1250000,
      "offset_z": 0,
      "point_length": 34,
      "project_id": "00000000-0000-0000-0000-000000000000",
      "scale_x": 0.01,
      "scale_y": 0.01,
      "scale_z": 0.01,
      "software_id": "PDAL 2.0.1 (369303)",
      "spatialreference": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]",
      "srs": {
        "compoundwkt": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]",
        "horizontal": "PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]]",
        "isgeocentric": false,
        "isgeographic": false,
        "prettycompoundwkt": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",\n    PROJCS[\"CH1903+ / LV95\",\n        GEOGCS[\"CH1903+\",\n            DATUM[\"CH1903+\",\n                SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,\n                    AUTHORITY[\"EPSG\",\"7004\"]],\n                TOWGS84[674.374,15.056,405.346,0,0,0,0],\n                AUTHORITY[\"EPSG\",\"6150\"]],\n            PRIMEM[\"Greenwich\",0,\n                AUTHORITY[\"EPSG\",\"8901\"]],\n            UNIT[\"degree\",0.0174532925199433,\n                AUTHORITY[\"EPSG\",\"9122\"]],\n            AUTHORITY[\"EPSG\",\"4150\"]],\n        PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],\n        PARAMETER[\"latitude_of_center\",46.9524055555556],\n        PARAMETER[\"longitude_of_center\",7.43958333333333],\n        PARAMETER[\"azimuth\",90],\n        PARAMETER[\"rectified_grid_angle\",90],\n        PARAMETER[\"scale_factor\",1],\n        PARAMETER[\"false_easting\",2600000],\n        PARAMETER[\"false_northing\",1200000],\n        UNIT[\"metre\",1,\n            AUTHORITY[\"EPSG\",\"9001\"]],\n        AXIS[\"Easting\",EAST],\n        AXIS[\"Northing\",NORTH],\n        AUTHORITY[\"EPSG\",\"2056\"]],\n    VERT_CS[\"LHN95 height\",\n        VERT_DATUM[\"Landeshohennetz 1995\",2005,\n            AUTHORITY[\"EPSG\",\"5128\"]],\n        UNIT[\"metre\",1,\n            AUTHORITY[\"EPSG\",\"9001\"]],\n        AXIS[\"Gravity-related height\",UP],\n        AUTHORITY[\"EPSG\",\"5729\"]]]",
        "prettywkt": "PROJCS[\"CH1903+ / LV95\",\n    GEOGCS[\"CH1903+\",\n        DATUM[\"CH1903+\",\n            SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,\n                AUTHORITY[\"EPSG\",\"7004\"]],\n            TOWGS84[674.374,15.056,405.346,0,0,0,0],\n            AUTHORITY[\"EPSG\",\"6150\"]],\n        PRIMEM[\"Greenwich\",0,\n            AUTHORITY[\"EPSG\",\"8901\"]],\n        UNIT[\"degree\",0.0174532925199433,\n            AUTHORITY[\"EPSG\",\"9122\"]],\n        AUTHORITY[\"EPSG\",\"4150\"]],\n    PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],\n    PARAMETER[\"latitude_of_center\",46.9524055555556],\n    PARAMETER[\"longitude_of_center\",7.43958333333333],\n    PARAMETER[\"azimuth\",90],\n    PARAMETER[\"rectified_grid_angle\",90],\n    PARAMETER[\"scale_factor\",1],\n    PARAMETER[\"false_easting\",2600000],\n    PARAMETER[\"false_northing\",1200000],\n    UNIT[\"metre\",1,\n        AUTHORITY[\"EPSG\",\"9001\"]],\n    AXIS[\"Easting\",EAST],\n    AXIS[\"Northing\",NORTH],\n    AUTHORITY[\"EPSG\",\"2056\"]]",
        "proj4": "+proj=somerc +lat_0=46.9524055555556 +lon_0=7.43958333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +vunits=m +no_defs",
        "units": {
          "horizontal": "metre",
          "vertical": "metre"
        },
        "vertical": "VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]",
        "wkt": "PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]]"
      },
      "system_id": "PDAL",
      "vlr_0": {
        "data": "AQABAAAADAAABAAAAQABAAEEAAABAAEAAgSxhx4AAAABCLGHCAAeAAYIAAABAI4jDgiwhwMAAAAADAAAAQAICAQMAAABACkjABAAAAEAYRYBELGHDQAmAAIQAAABAAgUAxAAAAEAKSM=",
        "description": "GeoTiff GeoKeyDirectoryTag",
        "record_id": 34735,
        "user_id": "LASF_Projection"
      },
      "vlr_1": {
        "data": "okW28/0ShUDpJjEIrBwuQKjGSzeJVXlA",
        "description": "GeoTiff GeoDoubleParamsTag",
        "record_id": 34736,
        "user_id": "LASF_Projection"
      },
      "vlr_2": {
        "data": "Q0gxOTAzKyAvIExWOTUgKyBMSE45NSBoZWlnaHR8Q0gxOTAzK3xMSE45NSBoZWlnaHR8AA==",
        "description": "GeoTiff GeoAsciiParamsTag",
        "record_id": 34737,
        "user_id": "LASF_Projection"
      },
      "vlr_3": {
        "data": "AgAAAAMEAQAAAAAAUMMAAP////////////////////8DAAYAFAACAAcACAACAAgABgACAA==",
        "description": "http://laszip.org",
        "record_id": 22204,
        "user_id": "laszip encoded"
      }
    },
    "origin": 0,
    "points": 1929125,
    "srs": {
      "authority": "EPSG",
      "horizontal": "2056",
      "wkt": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]"
    }
  }
}

Since I want to publish it along with other data stored in EPSG:2056 I need content shifted by correct offset.

As I said before: I thought entwine will take correct offset values from the input LAZ data. But it does not. Do you have an idea why?

Or asked the other way round: How can I prepare my data to be correctly recognized by entwine? Because I have to handle several single file datasets having all the same problems but different offsets to publish them as ETP in the context od EPSG:2056.

vvmruder commented 5 years ago

Ah ok I got it now... about this multi file offset problem :)

But still for single file it could take it directly. Right?

connormanning commented 5 years ago

It certainly could, but Entwine currently makes no distinction of the single-file case. So it performs the exact same determinations for the offset for one file vs. multiple files.

vvmruder commented 5 years ago

So for the moment the solution would be: Set offset by schema in config file.

vvmruder commented 5 years ago

Sorry for going on that again. But I completely need to write a full config.json this is a bit unhandy. EPT build seems to not calculate the bounds itself if I pass a config like this:

{
  "input": "ch.bl.bksd.sfm_51_036_ormalingen_gaissacker.laz/",
  "output": "ch.bl.bksd.sfm_51_036_ormalingen_gaissacker.ept/",
  "schema": [
    {
      "name": "X",
      "scale": 0.01,
      "size": 4,
      "type": "signed",
      "offset": 2620000.00
    },
    {
      "name": "Y",
      "scale": 0.01,
      "size": 4,
      "type": "signed",
      "offset": 1240000.00
    },
    {
      "name": "Z",
      "scale": 0.01,
      "size": 4,
      "type": "signed"
    },
    {
      "name": "Intensity",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "ReturnNumber",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "NumberOfReturns",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "ScanDirectionFlag",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "EdgeOfFlightLine",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "Classification",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "ScanAngleRank",
      "size": 4,
      "type": "float"
    },
    {
      "name": "UserData",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "PointSourceId",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "GpsTime",
      "size": 8,
      "type": "float"
    },
    {
      "name": "Red",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "Green",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "Blue",
      "size": 2,
      "type": "unsigned"
    }
  ]
}

Output in ept.json is:

{
  "bounds": [
    2794.0,
    8114.0,
    438.0,
    2808.0,
    8128.0,
    452.0
  ],
  "boundsConforming": [
    2797.0,
    8115.0,
    443.0,
    2805.0,
    8126.0,
    446.0
  ],
  "dataType": "laszip",
  "hierarchyType": "json",
  "points": 1929125,
  "schema": [
    {
      "name": "X",
      "offset": 2620000.0,
      "scale": 0.01,
      "size": 4,
      "type": "signed"
    },
    {
      "name": "Y",
      "offset": 1240000.0,
      "scale": 0.01,
      "size": 4,
      "type": "signed"
    },
    {
      "name": "Z",
      "scale": 0.01,
      "size": 4,
      "type": "signed"
    },
    {
      "name": "Intensity",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "ReturnNumber",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "NumberOfReturns",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "ScanDirectionFlag",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "EdgeOfFlightLine",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "Classification",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "ScanAngleRank",
      "size": 4,
      "type": "float"
    },
    {
      "name": "UserData",
      "size": 1,
      "type": "unsigned"
    },
    {
      "name": "PointSourceId",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "GpsTime",
      "size": 8,
      "type": "float"
    },
    {
      "name": "Red",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "Green",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "Blue",
      "size": 2,
      "type": "unsigned"
    },
    {
      "name": "OriginId",
      "size": 4,
      "type": "unsigned"
    }
  ],
  "span": 128,
  "srs": {
    "authority": "EPSG",
    "horizontal": "2056",
    "wkt": "COMPD_CS[\"CH1903+ / LV95 + LHN95 height\",PROJCS[\"CH1903+ / LV95\",GEOGCS[\"CH1903+\",DATUM[\"CH1903+\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[674.374,15.056,405.346,0,0,0,0],AUTHORITY[\"EPSG\",\"6150\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4150\"]],PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"],PARAMETER[\"latitude_of_center\",46.9524055555556],PARAMETER[\"longitude_of_center\",7.43958333333333],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",2600000],PARAMETER[\"false_northing\",1200000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"2056\"]],VERT_CS[\"LHN95 height\",VERT_DATUM[\"Landeshohennetz 1995\",2005,AUTHORITY[\"EPSG\",\"5128\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Gravity-related height\",UP],AUTHORITY[\"EPSG\",\"5729\"]]]"
  },
  "version": "1.0.0"
}
vvmruder commented 5 years ago

Sorry for the pushy unkind behaving. I have only one day left to try out all the cool things I took away from FOSS4G this year. After this I need to dive back into my "normal" job.

So long story short for other users who may stumble over this:

I got this working by actually translated (in geometric way) the whole point cloud with the amount of the offset. So I end up with absolute coordinates in the point cloud and could set the offset to "0". This allows me to combine all my point clouds together in one viewer to present them.

For translation and re-offset-ing I used las2las from Lastools: las2las -translate_xyz 2630000.00 1250000.00 0.0 -reoffset 0 0 0 -i ... -o ...

@connormanning : Maybe you have an easy hint how to do this with PDAL to have a PDAL/entwine only workflow?

After this I built my EPT as I was used to it and it worked as expected.

Thank you very much @connormanning and the others for this brilliant tool.

connormanning commented 5 years ago

I'm glad you got something working as you expected.

However since all EPT-capable tools (PDAL, Potree, Plasio, EPT Tools, etc) undo the scale/offset internal to EPT to achieve absolute values during reading, there is no need to care about the offset used by EPT in general. The offset shows you how to interpret the storage of bytes on disk, but any software that reads EPT will perform this interpretation for you. So you can combine point clouds in one viewer no matter what offset is used - absolute values will always be determined.

Unless you are trying to read raw bytes directly from LAZ directly by your own custom code, the offset used by EPT should be transparent to you.

And yes, you can also use PDAL for your re-offsetting workflow with the offset_x/y/z options to the LAS writer (doc).