@@ -7,29 +7,29 @@ import { getDownloadParquetUrl, DOWNLOAD_GRID_URL } from '../../layers/Download-
77import useSettings from '../useSettings'
88
99describe ( 'getDownloadParquetUrl' , ( ) => {
10- it ( 'builds a Source Cooperative URL using year and tile id' , ( ) => {
10+ it ( 'builds a Source Cooperative URL using year and tile id, with a year-prefixed filename ' , ( ) => {
1111 expect ( getDownloadParquetUrl ( 2025 , 'N40W100' ) ) . toBe (
12- 'https://data.source.coop/ftw/global-field-boundaries/download-tiles/geoparquet/2025/N40W100 .parquet' ,
12+ 'https://data.source.coop/ftw/global-field-boundaries/download-tiles/geoparquet/2025/2025_N40W100 .parquet' ,
1313 )
1414 } )
1515
1616 it ( 'handles southern/western hemisphere tiles' , ( ) => {
1717 expect ( getDownloadParquetUrl ( 2024 , 'S03E036' ) ) . toBe (
18- 'https://data.source.coop/ftw/global-field-boundaries/download-tiles/geoparquet/2024/S03E036 .parquet' ,
18+ 'https://data.source.coop/ftw/global-field-boundaries/download-tiles/geoparquet/2024/2024_S03E036 .parquet' ,
1919 )
2020 } )
2121} )
2222
2323describe ( 'DOWNLOAD_GRID_URL' , ( ) => {
24- it ( 'points to the download-tiles manifest on Source Cooperative' , ( ) => {
24+ it ( 'points to the v2 download-tiles manifest on Source Cooperative' , ( ) => {
2525 expect ( DOWNLOAD_GRID_URL ) . toBe (
26- 'https://data.source.coop/ftw/global-field-boundaries/download-tiles/ftw-download-grid.geojson' ,
26+ 'https://data.source.coop/ftw/global-field-boundaries/download-tiles/ftw-download-grid-v2 .geojson' ,
2727 )
2828 } )
2929} )
3030
3131describe ( 'featureToGridCell' , ( ) => {
32- it ( 'extracts tile metadata from feature properties' , ( ) => {
32+ it ( 'extracts tile metadata from feature properties, including per-year stats dicts ' , ( ) => {
3333 const feature = new Feature ( {
3434 geometry : new Polygon ( [
3535 [
@@ -44,8 +44,8 @@ describe('featureToGridCell', () => {
4444 lat_min : 40 ,
4545 lon_min : 0 ,
4646 years : [ 2024 , 2025 ] ,
47- feature_count : 1234 ,
48- size_bytes : 2_500_000 ,
47+ feature_counts : { '2024' : 1234 , '2025' : 1502 } ,
48+ size_bytes : { '2024' : 2_500_000 , '2025' : 2_780_000 } ,
4949 } )
5050
5151 const cell = featureToGridCell ( feature )
@@ -54,8 +54,8 @@ describe('featureToGridCell', () => {
5454 lat_min : 40 ,
5555 lon_min : 0 ,
5656 years : [ 2024 , 2025 ] ,
57- feature_count : 1234 ,
58- size_bytes : 2_500_000 ,
57+ feature_counts : { '2024' : 1234 , '2025' : 1502 } ,
58+ size_bytes : { '2024' : 2_500_000 , '2025' : 2_780_000 } ,
5959 } )
6060 } )
6161
@@ -84,7 +84,7 @@ describe('featureToGridCell', () => {
8484 years : [ 2025 ] ,
8585 } )
8686 const cell = featureToGridCell ( feature )
87- expect ( cell . feature_count ) . toBeUndefined ( )
87+ expect ( cell . feature_counts ) . toBeUndefined ( )
8888 expect ( cell . size_bytes ) . toBeUndefined ( )
8989 } )
9090
@@ -177,7 +177,7 @@ describe('useDownloadGrid', () => {
177177 expect ( handleGridClick ( fakeMap , [ 0 , 0 ] ) ) . toBe ( true )
178178 expect ( clickSpy ) . toHaveBeenCalled ( )
179179 expect ( anchor . href ) . toBe (
180- 'https://data.source.coop/ftw/global-field-boundaries/download-tiles/geoparquet/2025/N40W100 .parquet' ,
180+ 'https://data.source.coop/ftw/global-field-boundaries/download-tiles/geoparquet/2025/2025_N40W100 .parquet' ,
181181 )
182182 expect ( anchor . download ) . toBe ( 'ftw-fields-N40W100-2025.parquet' )
183183 } )
0 commit comments