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.

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

   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

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:

    grids: [GLOBAL_MERCATOR]
    sources: []
      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.


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.

Now that version 1.13.0 is out, this applies to additional cache types, such as geopackage files and s3 sources. So the quote above does not mean it can only be done with mbtiles exclusively.

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.