OSM, TileCache, and Mapnik - mapping

I have been trying for two and a half weeks so far to get a local copy of OpenStreetMap running on a server. I have downloaded the planet file and imported it into a PostGIS database called 'osm'. I have used OSM Mapnik tools to generate an XML stylesheet for Mapnik to use. I have used TileLite to prove that Mapnik can render OSM tiles from the database. The tiles even look the way that I want them to look.
My problem now is that I cannot get TileCache to work with Mapnik. I have a MapServer instance installed that I am using to serve Shapefiles. This works with TileCache. The default 'basic' layer in the TileCache configuration file works as well. Please help with my OSM layer:
[osm]
type=Mapnik
mapfile=/var/maps/bin/mapnik/osm.xml
spherical_mercator=true
bbox=-16697000,8610000,-16667000,8640000
maxResolution=156543.0339/4
levels=18
srs=EPSG:900913
I have read every last blog post, forum post, and tutorial I can find. Any help would be appreciated. I suspect I have either missed something or I am doing something stupid.

Nik,
I can understand the potential difficulties here and that you've tried a number of things. You did not say what exact problems you ran into however, so I'll guess that this is your problem:
You are using OpenLayers to test that the tiles are being produced correctly, but things don't line up when you connect to the tiles generated by TileCache.
That it? If not, please provide a bit more detail.
If that is the problem then likely what you need to do is to make sure to use a "TMS" layer type in OpenLayers and to match that with your TileCache.cfg layer params. "TMS" is very similar to the OSM tile scheme except that the y value is flipped.
Anyway, something like this should work:
tilecache.cfg
[osm]
type=Mapnik
mapfile=/full/path/to/osm.xml
spherical_mercator=true
OpenLayers Layer
var tms = new OpenLayers.Layer.TMS("TileCache TMS Layer","http://localhost:8000/",
{ serviceVersion: "1.0.0", layername: "osm", type: "png" });
map.addLayers([tms]);
I pulled this from an old example of mine from the first time I got this working: http://mapnik-utils.googlecode.com/svn/example_code/tilecache/openlayers_osm.html

Related

Edit Photos via Photoshop on a server

I wart to create a web app where a user enters certain data via a form and then receives a custom rendered image. The image is from a smart object in a psd. It's kind of like a mock-up which definitely requires needs some photoshop filters to be properly rendered.
This should all happen in real time and should be doable from my understanding since the rendering of a single images doesn't need much computing power
I've done some research and haven't really found a solution the matches my problem. Is it necessary to run Photoshop on a server and then remotely run a photoshop script and then upload the generated image somewhere else?
I've used The After Effects Plugin Template by DataClay in the past which offers similar functionality but for video.
Looking forward to hearing your ideas.
Thanks
You can use the Dataclay plugin to handle still image exports out of After Effects. Make a single-frame duration composition in After Effects and rig the layers with the Templater plugin. Then use the PNG Sequence output module to render out a single frame.
From Dataclay's forums:
Exporting
A few extra steps are required to correctly render a project file as a PNG sequence using Templater. By default, a file rendered as a PNG sequence will have the frame number appended to the end of the file name, i.e.:
filename.png00000, filename.png00001, filename.png00002, etc.
In order to designate where in the filename the frame number should be added, we’ll need to use the output column. First, add a column named output to your data source. Next, add a filename with a set of brackets with five # signs to designate where the frame numbering should be added. For example:
filename[#####] would result in filename00001.png
or
[#####]filename would result in 00001filename.png

Geojson fails to render correctly

Am trying to create a geojson map of a community forest. I created this geojson file by hand and it loads correctly in QGIS but doesn't work on geojson.io
Could anyone spot what I am doing wrong.
Sample GeoJson file
Remove the crs reference and try again, either at geojson.io or http://geojsonlint.com/ or https://kepler.gl/demo.
{"type":"FeatureCollection","name":"final","features":[{"type":"Feature","properties":{"shape":"Polygon","maps":"(1:default-map)","name":"Unnamed Layer","category":"default","id":"cd2df240-47e6-4b56-8250-8d2f4ccc1e72"},"geometry":{"type":"Polygon","coordinates":[[[7.78,99.0632],[7.7815,99.0627],[7.7816,99.0627],[7.7824,99.0625],[7.7828,99.0624],[7.7831,99.0623],[7.7832,99.0622],[7.7834,99.062],[7.7838,99.0614],[7.7839,99.0614],[7.784,99.0613],[7.7843,99.0611],[7.7876,99.0592],[7.7895,99.0578],[7.7893,99.0575],[7.7891,99.0574],[7.7883,99.0568],[7.7868,99.056],[7.7867,99.0559],[7.786,99.0557],[7.7854,99.0556],[7.7844,99.0554],[7.784,99.0552],[7.7837,99.055],[7.7834,99.0546],[7.7831,99.0544],[7.7826,99.0541],[7.7819,99.0537],[7.7816,99.0543],[7.7816,99.0545],[7.7796,99.053],[7.7802,99.052],[7.7795,99.0516],[7.7791,99.0514],[7.7786,99.0511],[7.7779,99.0505],[7.7771,99.0499],[7.7763,99.0492],[7.7761,99.049],[7.7758,99.0488],[7.7758,99.0488],[7.7755,99.0488],[7.7752,99.0489],[7.775,99.0493],[7.7748,99.0497],[7.7747,99.0498],[7.7746,99.05],[7.7743,99.0502],[7.7743,99.0502],[7.7739,99.0505],[7.7738,99.0506],[7.7737,99.0507],[7.7734,99.0514],[7.7723,99.0523],[7.7722,99.0523],[7.7721,99.0524],[7.772,99.0524],[7.7716,99.0524],[7.7713,99.0524],[7.7709,99.0523],[7.7703,99.0521],[7.7701,99.052],[7.7699,99.0519],[7.7696,99.0519],[7.7696,99.0519],[7.7695,99.0519],[7.7694,99.0519],[7.7692,99.052],[7.7691,99.052],[7.7687,99.0523],[7.7687,99.0523],[7.7685,99.0523],[7.7679,99.0523],[7.7678,99.0523],[7.7678,99.0513],[7.7682,99.0509],[7.7684,99.0508],[7.7686,99.0507],[7.7689,99.0506],[7.7691,99.0506],[7.7692,99.0506],[7.7693,99.0506],[7.7694,99.0504],[7.7695,99.0502],[7.7695,99.0502],[7.7696,99.0501],[7.7697,99.05],[7.77,99.0499],[7.7705,99.0498],[7.7708,99.0496],[7.771,99.0495],[7.771,99.0494],[7.7711,99.0494],[7.7712,99.0493],[7.7713,99.0493],[7.7715,99.0492],[7.7718,99.0492],[7.772,99.0492],[7.7722,99.049],[7.7723,99.0488],[7.7726,99.0483],[7.7727,99.048],[7.7727,99.0478],[7.7728,99.0475],[7.7728,99.0471],[7.7729,99.0471],[7.7731,99.0469],[7.7735,99.0467],[7.7738,99.0466],[7.7743,99.0464],[7.7743,99.0458],[7.7743,99.0456],[7.7743,99.0454],[7.7744,99.0453],[7.7747,99.0449],[7.7753,99.0441],[7.7755,99.0438],[7.7756,99.0437],[7.7756,99.0434],[7.7757,99.043],[7.7758,99.0425],[7.776,99.0419],[7.7763,99.0419],[7.7766,99.0418],[7.7767,99.0417],[7.7769,99.0416],[7.7772,99.0409],[7.7775,99.0402],[7.7776,99.04],[7.7776,99.04],[7.7777,99.0399],[7.7777,99.0399],[7.7777,99.0399],[7.7778,99.0399],[7.7778,99.0398],[7.7783,99.0398],[7.7783,99.0391],[7.7783,99.0384],[7.7783,99.0379],[7.7783,99.0376],[7.7786,99.037],[7.7792,99.0358],[7.7795,99.0357],[7.7795,99.0357],[7.7797,99.0356],[7.7799,99.0355],[7.7801,99.0354],[7.7802,99.0352],[7.7804,99.035],[7.7805,99.0348],[7.7805,99.0347],[7.7805,99.0346],[7.7805,99.034],[7.7806,99.0332],[7.7807,99.0326],[7.7808,99.032],[7.7809,99.0317],[7.7809,99.0317],[7.781,99.0316],[7.7811,99.0314],[7.7811,99.0313],[7.7812,99.0311],[7.7813,99.0309],[7.7814,99.0309],[7.782,99.0303],[7.7818,99.0299],[7.7817,99.0295],[7.7815,99.0288],[7.7811,99.0272],[7.7784,99.0278],[7.7793,99.0285],[7.7785,99.0291],[7.7782,99.0293],[7.778,99.0295],[7.7778,99.0299],[7.7776,99.0301],[7.7768,99.0299],[7.7766,99.0299],[7.7764,99.03],[7.7763,99.0302],[7.7762,99.0308],[7.776,99.0313],[7.7759,99.0315],[7.7756,99.0318],[7.7741,99.0308],[7.7739,99.0306],[7.7736,99.0295],[7.7734,99.0293],[7.773,99.0292],[7.7723,99.0292],[7.7717,99.0288],[7.7715,99.0287],[7.7711,99.0286],[7.7709,99.0286],[7.7692,99.0277],[7.7684,99.0284],[7.7677,99.0285],[7.7674,99.0267],[7.7673,99.0266],[7.7645,99.0244],[7.7638,99.028],[7.763,99.0292],[7.7628,99.0294],[7.7625,99.0294],[7.7623,99.0293],[7.7621,99.0294],[7.7618,99.0296],[7.7617,99.0299],[7.7608,99.0295],[7.7605,99.0295],[7.758,99.0298],[7.7573,99.0304],[7.7571,99.0305],[7.7553,99.0306],[7.7535,99.0293],[7.7532,99.0229],[7.7525,99.0224],[7.7523,99.0223],[7.7484,99.0232],[7.7481,99.0233],[7.7466,99.0241],[7.7463,99.0242],[7.7461,99.0242],[7.7406,99.0252],[7.7382,99.0263],[7.7368,99.0268],[7.7365,99.0269],[7.7337,99.0285],[7.7281,99.031],[7.7275,99.0313],[7.7273,99.0315],[7.726,99.0324],[7.7258,99.0325],[7.7255,99.0325],[7.7218,99.0331],[7.7215,99.0332],[7.7181,99.0348],[7.714,99.0366],[7.7136,99.0367],[7.7123,99.0369],[7.711,99.0371],[7.7099,99.0373],[7.7093,99.0376],[7.7079,99.0383],[7.7065,99.039],[7.7055,99.0394],[7.704,99.0397],[7.7036,99.0399],[7.703,99.0403],[7.7023,99.0407],[7.7014,99.0411],[7.7007,99.0413],[7.7003,99.0415],[7.7001,99.0416],[7.6999,99.0419],[7.6997,99.0423],[7.6997,99.0427],[7.6999,99.0432],[7.6999,99.0436],[7.6999,99.0443],[7.6997,99.0453],[7.6996,99.0459],[7.6993,99.0464],[7.699,99.047],[7.6987,99.0481],[7.6984,99.0498],[7.6981,99.0531],[7.6977,99.0556],[7.6975,99.0566],[7.6975,99.057],[7.6975,99.0608],[7.697,99.0639],[7.697,99.0641],[7.6969,99.0642],[7.6955,99.0662],[7.6953,99.0664],[7.6951,99.0675],[7.695,99.0678],[7.695,99.0679],[7.6952,99.068],[7.6956,99.0681],[7.6958,99.0682],[7.6959,99.0684],[7.6958,99.0686],[7.6955,99.0688],[7.6952,99.0691],[7.695,99.0695],[7.6944,99.071],[7.6937,99.0736],[7.693,99.0768],[7.693,99.0773],[7.6932,99.0785],[7.6931,99.0786],[7.6929,99.0787],[7.692,99.0792],[7.6919,99.0793],[7.6919,99.0795],[7.6919,99.0798],[7.692,99.081],[7.6921,99.0814],[7.692,99.0816],[7.6919,99.0818],[7.6912,99.0827],[7.691,99.0829],[7.6909,99.0831],[7.6909,99.0834],[7.691,99.0847],[7.6909,99.0851],[7.6907,99.0857],[7.6906,99.0861],[7.6906,99.0864],[7.6908,99.0875],[7.6907,99.0882],[7.6905,99.0898],[7.6902,99.091],[7.69,99.0918],[7.6901,99.0921],[7.6901,99.0923],[7.6903,99.0925],[7.6904,99.0928],[7.6916,99.0959],[7.6918,99.0961],[7.6919,99.0963],[7.6922,99.0966],[7.6924,99.0969],[7.693,99.0979],[7.6933,99.0981],[7.6935,99.0982],[7.6937,99.0981],[7.6939,99.098],[7.6946,99.0972],[7.6951,99.0965],[7.6954,99.0956],[7.6955,99.0954],[7.6958,99.0952],[7.6961,99.0949],[7.6959,99.0939],[7.6955,99.0925],[7.6961,99.0913],[7.6966,99.09],[7.6967,99.0897],[7.6968,99.0896],[7.6971,99.0893],[7.6973,99.0889],[7.6982,99.0877],[7.6984,99.0875],[7.6994,99.0869],[7.6996,99.0865],[7.6998,99.0857],[7.7,99.0855],[7.7002,99.0854],[7.7006,99.0853],[7.7006,99.0848],[7.7007,99.0847],[7.7009,99.0847],[7.7014,99.0847],[7.7015,99.084],[7.7009,99.0838],[7.7008,99.0838],[7.7002,99.0844],[7.7,99.0844],[7.6997,99.0844],[7.6984,99.0841],[7.6993,99.0833],[7.7013,99.0827],[7.7028,99.0826],[7.7029,99.0825],[7.7035,99.0818],[7.7041,99.0819],[7.7042,99.0818],[7.7043,99.0817],[7.7046,99.0809],[7.7039,99.0809],[7.7029,99.0813],[7.7028,99.079],[7.7033,99.0786],[7.7034,99.0785],[7.704,99.0784],[7.7043,99.0783],[7.7048,99.0782],[7.7051,99.0771],[7.7054,99.077],[7.7061,99.0768],[7.7067,99.0768],[7.7071,99.0769],[7.7074,99.0769],[7.7076,99.0769],[7.7079,99.0758],[7.7081,99.0757],[7.7098,99.0748],[7.7098,99.0739],[7.7088,99.0736],[7.7087,99.0737],[7.7081,99.0738],[7.7069,99.0726],[7.7094,99.07],[7.7092,99.0679],[7.7103,99.0666],[7.7114,99.0649],[7.7126,99.063],[7.7136,99.0623],[7.7146,99.0619],[7.7143,99.061],[7.7152,99.0599],[7.7178,99.0568],[7.7179,99.0559],[7.7231,99.0533],[7.7253,99.0527],[7.7268,99.0531],[7.727,99.0533],[7.7257,99.0558],[7.7241,99.0562],[7.7236,99.0567],[7.7234,99.057],[7.7221,99.0579],[7.7211,99.0595],[7.7218,99.0601],[7.722,99.0602],[7.7223,99.0601],[7.7224,99.0601],[7.7226,99.0601],[7.7229,99.06],[7.7245,99.0615],[7.7251,99.0618],[7.7257,99.0621],[7.7264,99.0626],[7.726,99.0641],[7.7259,99.0642],[7.7245,99.0646],[7.7243,99.0646],[7.724,99.0646],[7.7226,99.0641],[7.721,99.0649],[7.7208,99.0656],[7.7202,99.0662],[7.7212,99.066],[7.721,99.0667],[7.7229,99.0668],[7.7231,99.0669],[7.7234,99.067],[7.7241,99.0678],[7.7244,99.0679],[7.7257,99.0677],[7.7268,99.0676],[7.7285,99.0678],[7.7311,99.0683],[7.732,99.0692],[7.7322,99.0693],[7.7326,99.0693],[7.7327,99.0692],[7.7327,99.069],[7.7325,99.0688],[7.7321,99.0684],[7.7326,99.068],[7.7327,99.0678],[7.7326,99.0676],[7.7324,99.0675],[7.7324,99.0672],[7.7327,99.0662],[7.7339,99.0655],[7.7348,99.0631],[7.7358,99.0629],[7.7376,99.0622],[7.7387,99.0623],[7.7404,99.0661],[7.7404,99.0677],[7.7416,99.0684],[7.7427,99.0681],[7.743,99.0681],[7.745,99.0683],[7.7458,99.0674],[7.7462,99.0671],[7.747,99.0666],[7.7481,99.0669],[7.7486,99.0672],[7.7491,99.0678],[7.7495,99.0692],[7.7496,99.0693],[7.7501,99.0694],[7.7508,99.0693],[7.7518,99.0697],[7.7542,99.07],[7.7549,99.0698],[7.7556,99.0702],[7.7553,99.0688],[7.7563,99.0677],[7.7577,99.0673],[7.7581,99.0662],[7.7582,99.0652],[7.7589,99.0656],[7.759,99.0664],[7.7617,99.0648],[7.7618,99.0648],[7.7634,99.0655],[7.7644,99.0656],[7.7653,99.0648],[7.7653,99.0647],[7.7667,99.0641],[7.7682,99.0635],[7.7699,99.063],[7.7704,99.0628],[7.7714,99.0633],[7.7717,99.0634],[7.7719,99.0633],[7.772,99.0633],[7.7726,99.063],[7.7732,99.0629],[7.7735,99.0629],[7.7737,99.063],[7.7739,99.063],[7.7742,99.0632],[7.7746,99.0634],[7.7748,99.0635],[7.7749,99.0635],[7.7752,99.0635],[7.7754,99.0635],[7.7755,99.0635],[7.7757,99.0635],[7.776,99.0637],[7.7765,99.064],[7.7766,99.064],[7.7769,99.0641],[7.7774,99.0638],[7.7775,99.0638],[7.7777,99.0638],[7.7777,99.0638],[7.7779,99.0638],[7.7781,99.0638],[7.7783,99.0638],[7.7786,99.0638],[7.7788,99.0637],[7.78,99.0632]]]}}]}
Either way, it looks like your projection/coordinate system is not WGS84:
I mean, your geojson is now valid but most certainly not what you actually drew. So before you export from QGIS, make sure you select the correct coordinate system. 5sec of googling: https://gis.stackexchange.com/a/35595 or http://jonathansoma.com/tutorials/mapping/change-crs-with-qgis/

Simple example in Extjs6.5 Fiddle not working

I'm trying to generate a basic project with a store "Pathstore" and data "data.json" in my Extjs6.5 Fiddle but it goes not well.I'm not sure what paths I need to specify in my application to load.How can I do for this?
Thanks in advance, Ben
Here's the the fiddle:
https://fiddle.sencha.com/#view/editor&fiddle/25vm
I add console.log in my store and I get nothing.
So a few things:
You don't need to use requires here
Your PathStore has a lot of unneeded configs in the proxy config (see fiddle below)
You didn't have a data model specified.
There were some errors in your JSON config.
the folder is store.PathStore.js so it was not required to use app.store.PathStore
I organized your fiddle a little bit better and made it working. Here is a working version of you fiddle:
https://fiddle.sencha.com/#view/editor&fiddle/271g

Loading a .trig file with inference to Fuseki using the 'tdbloader" bulk loader?

I am currently writing some Java code extracting some data and writing them as Linked Data, using the TRIG syntax. I am now using Jena, and Fuseki to create a SPARQL endpoint to query and visualize this data.
The data is written so that each source dataset gives me a .trig file, containing one named graph. So I want to load thoses files in Fuseki. Except that it doesn't seem to understand the Trig syntax...
If I remove the named graphs, and rename the files as .ttl, everything loads perfectly in the default graphs. But if I try to import trig files :
using Fuseki's webapp uploader, it either crashes ("Can't make new graphs") or adds nothing except the prefixes, as if the graphs other than the default ones could not be added (the logs say nothing helpful except the error code and description).
using Java code, the process is too slow. I used this technique : " Loading a .trig file into TDB? " but my trig files are pretty big, so this solution is not very good for me.
So I tried to use the bulk loader, the console command 'tdbloader'. This time everything seems fine, but in the webapp, there is still no data.
You can see the process going fine here : Quads are added just fine
But the result still keeps only the default graph and its original data : Nothing is added
So, I don't know what to do. The guys behind Jena and Fuseki suggested not to use the bulk loader in the Java code (rather than the command line tool), so that's one solution I guess I'd like to avoid.
Did I miss something obvious about how to load TRIG files to Fuseki? Thanks.
UPDATE :
As it seemed to be a problem in my configuration (see the comments of this post for a link to my config file; I cannot post more than 2 links), I tried to add some kind of specification for some named graphs I would like to see added to the dataset on Fuseki.
I added code to link (with ja:namedgraph) external graphs that I added via tdbloader. This seems to work. Great!
Now another problem : there's no inference, even when my config file specifies an Inference model... I set that queries should be applied with named graphs merged as the default graph, but this does not seem to carry the OWL Inference rules...So simple queries work, but I have 1/ to specify the graph I query (with "FROM") and 2/ no inference in my data.
The two methods are to use the tdb bulkloader offline or you can POST data into the dataset directly. (i.e. HTTP POST operations to http://localhost:3030/ds).
You can test where your graph are there with a query like
SELECT (count(*) AS ?C) { GRAPH ?g { ?s ?p ?o } }
The named graphs will show up when the Fuseki server is started unless your configuration of the SPARQL services only exports one graph.

Translating server file paths to URLs in Codeigniter

I'm developing my first application in Codeigniter 2.0.2, and I've got a minor issue I can't seem to find any info about on the web.
The application revolves around resources stored locally on the server (namely images and audio files) which need to be exposed to the user. The locations of these resources are stored in a DB as absolute paths. As a result, I find myself needing to translate server paths to base_url-based URLs fairly often.
I already wrote a simple and robust-enough function to handle it for me, but with all the seemingly-relevant helpers in CI (url, path), I can't shake the feeling that I just reinvented the wheel.
At the least, I would think there would be some kind of CI function (say, "basify") that will translate any server path to a base_url-relative path like so:
$server_path = '/server/path/to/app/resources/image.jpg';
basify( $server_path ); // returns 'resources/image.jpg' or './resources/image.jpg'
where the CI app lives in /server/path/to/app. Then it's a simple call to base_url() to make the URL.
Does anything like that exist?
Edit: And yes, I know that a simple preg_replace will handle most cases for me (at least those where the resource is within the base path), but I feel like this should be CI's job, not mine! Half the reason I'm using it is because I don't want to think about path management.
Maybe you can use php function str_replace together with codeigniter FCPATH constant.
Your code will be:
function basify($image_path) {
return str_replace(FCPATH, '', $image_path);
}
The FCPATH constant is new to me, but I have done some tests and it works fine.

Resources