File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed
packages/python/goatlib/src/goatlib/tasks Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -411,28 +411,9 @@ def _detect_geometry_type(
411411
412412 @staticmethod
413413 def _has_anchor_layer (pmtiles_path : "Path" ) -> bool :
414- """Check if a layer already has anchor label points.
415-
416- Checks for a separate anchor PMTiles file (new two-file approach)
417- or a default_anchor layer in the main file (legacy merged approach).
418- """
419- # New approach: separate anchor PMTiles file
414+ """Check if a layer already has a separate anchor PMTiles file."""
420415 anchor_path = pmtiles_path .with_name (pmtiles_path .stem + "_anchor.pmtiles" )
421- if anchor_path .exists ():
422- return True
423-
424- # Legacy: check for default_anchor layer inside merged PMTiles
425- try :
426- from pmtiles .reader import MmapSource
427- from pmtiles .reader import Reader as PMTilesReader
428-
429- with open (pmtiles_path , "rb" ) as f :
430- reader = PMTilesReader (MmapSource (f ))
431- meta = reader .metadata ()
432- layers = [layer ["id" ] for layer in meta .get ("vector_layers" , [])]
433- return "default_anchor" in layers
434- except Exception :
435- return False
416+ return anchor_path .exists ()
436417
437418 def _process_layer (
438419 self : Self ,
You can’t perform that action at this time.
0 commit comments