Skip to content

Commit

Permalink
Merge pull request #6570 from pulibrary/6569-titiler
Browse files Browse the repository at this point in the history
Update TiTiler URLs
  • Loading branch information
tpendragon authored Dec 13, 2024
2 parents e5aa659 + 2082673 commit 3bb839e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/values/tile_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ def initialize(resource)

def tilejson
return unless valid?
"#{tileserver}/#{id}/#{endpoint}/tilejson.json"
"#{tileserver}/#{id}/#{endpoint}/WebMercatorQuad/tilejson.json"
end

def wmts
return unless valid?
"#{tileserver}/#{id}/#{endpoint}/WMTSCapabilities.xml"
"#{tileserver}/#{id}/#{endpoint}/WebMercatorQuad/WMTSCapabilities.xml"
end

def xyz
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/tile_metadata_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

get :tilejson, params: { id: raster_set.id, format: :json }

expect(response).to redirect_to "https://map-tiles-test.example.com/#{raster_set.id.to_s.tr('-', '')}/mosaicjson/tilejson.json"
expect(response).to redirect_to "https://map-tiles-test.example.com/#{raster_set.id.to_s.tr('-', '')}/mosaicjson/WebMercatorQuad/tilejson.json"
end
it "returns not_found if not given a mosaic" do
scanned_resource = FactoryBot.create_for_repository(:scanned_resource)
Expand Down
2 changes: 1 addition & 1 deletion spec/services/geo_discovery/document_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
geo_work
id = geo_work.id.to_s.delete("-")
refs = JSON.parse(document["dct_references_s"])
expect(refs["http://www.opengis.net/def/serviceType/ogc/wmts"]).to eq "https://map-tiles-test.example.com/#{id}/mosaicjson/WMTSCapabilities.xml"
expect(refs["http://www.opengis.net/def/serviceType/ogc/wmts"]).to eq "https://map-tiles-test.example.com/#{id}/mosaicjson/WebMercatorQuad/WMTSCapabilities.xml"
expect(refs["https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames"]).to eq "https://map-tiles-test.example.com/#{id}/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}@1x.png"
end

Expand Down
6 changes: 3 additions & 3 deletions spec/values/tile_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
scanned_map2 = FactoryBot.create_for_repository(:scanned_map_with_raster_children)
map_set = FactoryBot.create_for_repository(:scanned_map, member_ids: [scanned_map1.id, scanned_map2.id], id: "331d70a5-4bd9-4a65-80e4-763c8f6b34fd")

expect(described_class.new(map_set).tilejson).to eq "https://map-tiles-test.example.com/331d70a54bd94a6580e4763c8f6b34fd/mosaicjson/tilejson.json"
expect(described_class.new(map_set).tilejson).to eq "https://map-tiles-test.example.com/331d70a54bd94a6580e4763c8f6b34fd/mosaicjson/WebMercatorQuad/tilejson.json"
end
end

context "with a ScannedMap that has a child RasterResource" do
it "returns a cog tilejson path" do
scanned_map = FactoryBot.create_for_repository(:scanned_map_with_raster_children)

expect(described_class.new(scanned_map).tilejson).to eq "https://map-tiles-test.example.com/testgeo/cog/tilejson.json"
expect(described_class.new(scanned_map).tilejson).to eq "https://map-tiles-test.example.com/testgeo/cog/WebMercatorQuad/tilejson.json"
end
end

Expand All @@ -26,7 +26,7 @@
file_set = FactoryBot.create_for_repository(:geo_raster_cloud_file)
raster = FactoryBot.create_for_repository(:raster_resource, member_ids: [file_set.id], id: "331d70a5-4bd9-4a65-80e4-763c8f6b34fd")

expect(described_class.new(raster).tilejson).to eq "https://map-tiles-test.example.com/testgeo/cog/tilejson.json"
expect(described_class.new(raster).tilejson).to eq "https://map-tiles-test.example.com/testgeo/cog/WebMercatorQuad/tilejson.json"
end
end
end
Expand Down

0 comments on commit 3bb839e

Please sign in to comment.