I am new to the GeoServer/database world. I have never done any database work before, but I need to set up a WMS using GeoServer as part of my student internship.
I am using GeoServer 2.0.1 in standalone mode (downloaded using Jetty) with PostgreSQL 8.4 installed. I went through nyc_roads and nyc_buildings install demo in the GeoServer documentation but I still do not understand how I should go about serving up some test images. I noticed that the nyc_roads setup included a .sql file that was responsible for setting up the nyc_buildings database. I do not know how/where this file was generated.
Our test images are .tiff and .jpeg. I have successfully been able to do a WMS call on the local GeoServer machine, and have opened the included demo imagery. I now wish to add these .tiff and .jpeg images to GeoServer and access them through WMS. I have tried copying the images to the GeoServer data directory, adding a new data store and layers, but I always receive an error regarding the input stream.
I am sorry if I am leaving out vital information, this is as much as I know.
EDIT:
As described in the comment below, I am confused as to why GeoServer wont publish a GeoTiff image layer. I've made a separate workspace and data store for it. When I go to add the GeoTiff image, the bounding boxes/Geo coordinates are read properly, along with the correct EPSG format. When I'm happy with the settings, I click save, but nothing happens. No error messages or warnings.
Upload your GeoTIFF (*.tif) file to a folder on your server.
Open GeoServer home. Sign in to the server (default user admin pwd geoserver). Select WORKSPACES on the left menu.
Create a new workspace and call it whatever you want.
Create a new store
and choose GeoTIFF.
Click on the BROWSE button next to the fileName and select your GeoTIFF.
If it is properly created, the bounding box should appear with the correct coordinates. Select WMS service (VERY IMPORTANT).
Check this tutorial for a complete run through.
Call WMS layer from JavaScript using Openlayers.
Related
I am trying to load a custom model with a texture into Forge Autodesk viewer, using the function loadModel(), that I found here.
The other day, the model was loading, but without its texture, and no error appeared...
As usual, strange things happened during the night, and today, the model does not even appear in the viewer. This time, I get the following error :
Uncaught TypeError: Cannot read property 'proteinType' of undefined
At first, my model was a zip folder, containing an .obj, a .mtl and a .png (for the texture). I translated it into svf using Forge extractor.
So I am using, locally, in a 'Resources/3Dmodel' folder, ths resulting svf folder. It contains the .tif.png texture, the .svf file, a Materials.json.gz archive and other usual files in a svf folder (properties, camera definitions...).
There is no ProteinMaterials.json.gz archive.
So I can suppose the issue may come from the Materials.json file... I opened it, but I don't see anthing unusual inside...
So if anyone has an idea...
EDIT !
I had written in my code :
window.NOP_VIEWER.loadModel(svfPath_test, options), (myobj) => {
myobj.id = id;
myobj.name=name;
myobj.path=svfPath_test;
})
and nothing was loading.
After writing only this :
window.NOP_VIEWER.loadModel(svfPath_test, options)
the object appears, but completely gray, the texture is still not applied... and now I have this new error :
Texture load error 404 (NotFound)
It does not find the texture in the folder, but IT IS in the folder, with the right name ! So : I am starting to wonder if the image really is on the server... or not. I don't know how to check this or insert the image in the server.
Keep in mind that there is Autodesk Forge Viewer Usage Limitations Disclaimer stating that "The Autodesk Forge viewer can only be used to view files generated by Autodesk Forge services. The Autodesk Forge Viewer JavaScript must be delivered from an Autodesk hosted URL".
Nevertheless, from engineering perspective, the reasons of your troubles could vary. Could be the version of the viewer you use is not compatible with translation viewer.
From what I remember, the Forge extractor sample creates self contained (locally downloaded all dependencies) project, but for conversion it uses the Forge servers.
There might me a "misalignment" between version of the Model Derivative API and the version of Forge Viewer you use.
I would suggest, to convert your model using the official way, serve your model from the server and put it into a created from scratch basic Viewer.
Then gradually add/replace/integrate/"migrate" to the "airplane mode"
and identify at which step it breaks your model.
Or just change the locally served viewer3D.js, three.js and style.css to remote src and you can even try to play with Viewer version you use in your project by changing/adding the versioning. For example the lates one is:
<script src="https://developer.api.autodesk.com/derivativeservice/v2/viewers/viewer3D.min.js?v=v4.1"></script>
Now, if I put back the legal hat, be careful with legal aspect of your use-case.
I downloaded a binary via docker for the Gogs project (https://github.com/gogits/gogs), set it up (via docker pull gogs/gogs) and the server works as expected. Now I'm trying to customize the html a bit to look consistent with our company's other tools. When looking at deployed project, the assets of interest are in the following directories:
public/img/*.png
public/css/*.css
templates/*.tmpl
When I update the css, changes take effect right away, when I update tmpl, I need a container restart (implying that html is generated at server start time), when I update anything in public/img/ directory, however, I can't seem to get those assets used at all and I'm clueless about what's happening since most web servers/frameworks treat public/img/ as a static directory with all of its contents publicly visible by default.
Here is what I've tried so far and the outcomes:
Action: copied a new favicon image (my_favicon.png) into public/img/ and changed /templates/base/head.html to point to it (/img/my_favicon.png) instead of the original (/img/favicon.png), left original untouched and restarted the container.
Result: page loads with broken image icon, DOM inspector says that it's pointing to /img/my_favicon.png but doesn't show the image, going to that URL directly doesn't show the image either.
Action: change .tmpl back to point to original image (/img/favicon.png), overwrite original with the new image. I tried this with the main lg-gogs.png logo too.
Result: page loads with broken image icon just like before.
A grep search for image name revealed that only the .tmpl I modified and config.codekit are mentioning it (and I'm not at all familiar with CodeKit, but the instructions claim that it's only relevant for git, not me, and to leave the file alone, although it seems to profile names and sizes of all images - however I don't see anything else on the server reference this codekit file).
I have no idea why changes to css and tmpl work fine, but images cause this unexpected result. Does anyone have an idea of what's going on, why the server isn't accepting the images?
The problem was appeared when I migrate my site from WindowsServer2003 to CentOS.
There is a image field in the Node type.In the old server everything goes well,but in the CentOS the nodes' image field do not show the picture. It just show the image name as a link and click the image name I can see the picture in a new browser tab.
I know that the images have been upload in the sites/default/files. And also the permission for the directory is 777.
I google a lot but get no results.
so what cause the problem? any suggestions are appreciated.
Windows and Unix-based systems use different pathing syntax, so the paths for your images may not work now, under CentOS. Use a text editor's find-and-replace feature to change the paths in the database by exporting the database to a SQL file, running the find-and-replace, and then importing the file. Make sure to keep backups of everything.
I'm using offline maps downloaded from OpenStreetMaps on my Android application.
When I move the map some tiles do not appears.
I whould like to choose the area of n kilometers by m kilometers or something else.
You are curently just getting the tiles osmdroid has in it's cache. It caches tiles automaticaly as it downloads the. There is no easy way of getting tiles into the cache without first trying to display them with online enabled.
If you realy want offline support you have to prepare a file with the tiles you need and get it into the sdcard/osmdroid/ direcrctory. The simplest method of creating the file is to use a tool like Mobile Atlas Creator I would recomend the GEMF format over .zip it just works far better procedure is the same just copy the file and it is found automaticaly.
I'm trying to see what a certain webpage would look like if I replaced a certain image with another. Rather than upload the image, edit the site, etc, each time I tweak it, I'd like to know if there's a way to change the image in the page to my local version while viewing the remote page.
I use Firebug for debugging web development usually, but I'm open to any other tool that might do this.
(It is absolutely impossible to search for this and find anything but questions about dynamic image swapping on a deployed website, so sorry if this is a duplicate.)
Added: I just tried substituting a file:/// URI pointing to the image (copied and pasted from the address bar after manually opening the image), and alas, it did not work — the image fails to change.
It seems to only work with the http[s] protocols (likely for security reasons). You can store your images on service like Dropbox, share the image or folder, then use the public URLs.
Really, you can use any web accessible images, so a local server would work too.
If your image is in a localhost server(not as file mind you) i think you can still put that localhost url in the firebug inspect element and it'll work.
Tried an absolute file path but it doesn't work apparently. So I guess you just have to make do with a localhost server image. That works for me
Quick and Lowtech Answer: Take a screen shot of the page open it in photoshop and drop the local image on a layer above the webpage image.
Hi if you are serving from a webserver, u probably can't point it to a file on ur local drive. Even if its localhost, u can't point to a local file c:/test.jpg for example. Its because the browser sorts of sandbox ur page so that scripts can't access local files.
One way is to upload the new file (new_file.jpg) to the webserver, give the image link an id
<img id="something1" src="test.jpg"/>
Using jQuery in the firebug watch window do
$("#something1").attr("src","new_file.jpg");
You should see the image change. If you are not using jQuery, you can use document.getElementById("something1") and get the element to modify.
Another way is to use http://makiapp.com/
You can overlay an image from you computer onto any website you look at with this. Very cool tool for lining up a comp with your code.
You can:
Drag your test image into Google Drive
Open it in a browser
Go to the actual image path
Use this path as a substitute in Firebug
It's almost as fast as working from a local drive.