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

has mosaics in overlapping areas #684

Open
mingnet opened this issue Sep 29, 2018 · 3 comments
Open

has mosaics in overlapping areas #684

mingnet opened this issue Sep 29, 2018 · 3 comments

Comments

@mingnet
Copy link

mingnet commented Sep 29, 2018

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?

@jbouffard
Copy link
Collaborator

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 🙁

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.

@mingnet
Copy link
Author

mingnet commented Oct 23, 2018

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

@jbouffard
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants