4

I have local files of the already built cache. Now I try to configure a layers which gets the cache layer and shows it, but the problem is that I can't make it ignore the original "sources" because it always asks me to specify the source and I don't want it to try get new layers from the server.

layers:
  - name: Earth
    title: EarthA
    sources: [eartch_cache]
caches:
  earth_cache:
    grids:[gm_flat]
    sources: []  #<- I can't do this, although I want something like that

globals:
 cache:
   base_dir: S:\CACHCE

It's not the whole configuration but its the important parts...

Is there any way to make MapProxy work with only cache?

I'm not familiar with MapProxy.

  • I'm re-opening this question in response to a flag by a user who says that they have an answer to post. – PolyGeo Oct 15 '16 at 10:25
2

Leaving the sources array empty is allowed when you specify an explicit cache property. The following example uses an mbtiles cache, but any cache format should work:

caches:
  local_only:
    grids: [GLOBAL_MERCATOR]
    sources: []
    cache:
      type: mbtiles

When you use the local_only cache in a layer, it will load its data from cache_data/local_only.mbtiles only.

I tested this with MapProxy 1.8.2, but I was unable to find the matching entry in the change log, so I don't know what the first version is that supports this feature.

Update

I just found the following statement in the caches/mbtiles section in the docs:

You can set the sources to an empty list, if you use an existing MBTiles file and do not have a source.

So it seems like the empty sources array only works with mbtiles caches.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.