geopyspark icon indicating copy to clipboard operation
geopyspark copied to clipboard

has mosaics in overlapping areas

Open mingnet opened this issue 6 years ago • 3 comments

When two tiff images overlap, the sliced data has mosaics in overlapping areas. The overlap area of two tiff images may be different because of different shooting times. The system seems to randomly take data from two tiff images.

I ingest the data like this.

    tiflist = [os.path.join(basepath, b) for b in filelist]
    raster_layer = gps.geotiff.get(layer_type=gps.LayerType.SPATIAL, uri=tiflist,num_partitions=100)
    raster_layer.persist(pyspark.StorageLevel.MEMORY_AND_DISK_SER)
    tiled_layer = raster_layer.tile_to_layout(layout=gps.GlobalLayout(), target_crs=3857)
    pyramid = tiled_layer.pyramid()
    for layer in pyramid.levels.values():
        gps.write(destpath, key, layer, time_unit=gps.TimeUnit.DAYS)

what should I do?

mingnet avatar Sep 29 '18 03:09 mingnet

Hello, @mingnet! Let me first apologize for taking so long to respond to your issue. I had to do work on other projects which kept me from GPS :slightly_frowning_face:

To make sure that I'm understanding correctly: you have images that were taken at different times that cover the same area. You want the data that was taken at different times to segregated by that time when saving the layer. Is that correct?

If so, I think I see your issue.

raster_layer = gps.geotiff.get(layer_type=gps.LayerType.SPATIAL, uri=tiflist,num_partitions=100)

The line above reads in the data as a SPATIAL layer. However, this is not what you'd want as it only takes space into consideration but not time. Instead, you'd want to read it in as a SPACETIME layer. This will make it so that each raster your read in with be indexed by both the area it covers and the time the data was taken. I believe that if you read in the layer as SPACETIME all of your issues should be resolved.

jbouffard avatar Oct 16 '18 16:10 jbouffard

Anyway, thank you very much. This may be a solution. Let me try to do this.

mingnet avatar Oct 23 '18 07:10 mingnet

@mingnet Don't mention it! I hope that it works.

jbouffard avatar Oct 24 '18 13:10 jbouffard