How to make srtm data part of geoserver - geoserver

I have downloaded srtm data, which has the below structure:
srtm_51_08
srtm_51_08.hdr
srtm_51_08.tfw
srtm_51_08.tif
Now inside geoserver folder where do i copy-paste this "srtm_51_08" folder ?
I am using geoserver version 2.11.1.
When i pasted it inside \data_dir\workspaces\ folder, the geoserver started up with the warning:
" WARN [org.geoserver] - Ignoring workspace directory workspaces/srtm_51_08 "
How do i include it, so that it is not ignored by geoserver, as i want to use it in my app as below:
var globe = new Cesium.Globe(Cesium.Ellipsoid.WGS84);
var terrainProvider = new Cesium.GeoserverTerrainProvider({
url: "http://localhost:8080/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities",
layerName: "srtm_51_08",
});
globe.terrainProvider = terrainProvider;

Did you try looking in the manual? May be the section on World Images or preferably convert it to a geotiff and use GeoTiffs?

Related

Can't access the blob folder but files inside it are able to download

I have azure storage where I am using containers to store blobs. I am trying to download the blob from this container. But either using python SDK or rest, I am getting error "The specified blob does not exist." but when I giving the full path with the final file such as .txt or whatever instead of root folder, it is able to download it.
For example:
following URL gives error https://mlflowsmodeltorage.blob.core.windows.net/mlflow-test/110/63e7b9f2482b45e29b8c2983fa9522ef/artifacts/models The specified blob does not exist.
but the URL https://mlflowsmodeltorage.blob.core.windows.net/mlflow-test/110/63e7b9f2482b45e29b8c2983fa9522ef/artifacts/models/conda.yaml able to download the file.
Same thing happens with the python SDK. But I want to download the whole folder rather than the files inside it.
How can I achieve it.
Below is the code I am using to access the blob using pytohn SDK
from azure.storage.blob import BlobServiceClient
STORAGEACCOUNTURL = "https://mlflowsmodeltorage.blob.core.windows.net"
STORAGEACCOUNTKEY = "xxxxxxxxxxxxxx"
CONTAINERNAME = "mlflow-test"
BLOBNAME = "110/63e7b9f2482b45e29b8c2983fa9522ef/artifacts/models/"
blob_service_client_instance = BlobServiceClient(
account_url=STORAGEACCOUNTURL, credential=STORAGEACCOUNTKEY,
)
blob_client_instance = blob_service_client_instance.get_blob_client(
CONTAINERNAME, BLOBNAME, snapshot=None)
blob_data = blob_client_instance.download_blob()
data = blob_data.readall()
print(data)

I cant make a dynamic image path in pdf

I've been trying to display an image in a fpdf file, it only works when I specify the exact location of the image. Can I make it dynamic?
Heres sample line of code:
$this->Image('fpdf/img/logo1.png',10,6,30);
and it works when I turn this way:
D:\Installed Apps\New
folder\XAMPP\htdocs\votingsystem\application\views\admin\senior\fpdf\img\logo1.png',10,6,30);
I want to transfer it to another laptop, I'm afraid it wont work.
I always get this error:
Message: fopen(fpdf/img/logo1.png): failed to open stream: No such
file or directory
I use code igniter as framework.
You can use multicell option in fpdf. I use this below code in php to it working.
`
define('ASSETS_URL','Your url or path to image file');
$yaxix = $pdf->GetY();
$xaxix = $pdf->GetX();
$pdf->MultiCell(50,10.5,$pdf->Image(ASSETS_URL.'/img/your-image-name.jpg',$xaxix,$yaxix+5,50)."\nAuthorised Signatory",1,'C',FALSE);
`
In this case you only have to change constants.

How to reference script files in webpack deploy?

I am using webpack and electron and while I can reference my script files fine locally (app/scripts/scriptname.sh), when it comes to the production deploy, I get an error: Can't open app/components/scripts/scriptname.sh.
It's unclear to me if this is an electron-dependent issue or a webpack-issue.
I am running these using node child_process as:
var ls = spawn('sh', ['app/components/scripts/scriptname.sh']);
I don't necessarily need the scripts to be in their own folder it would just be helpful.
You need to provide the complete absolute path to the script. To do that you can use the app.getAppPath() API of electron
app.getAppPath()
Returns String - The current application directory.
So your code would be something like:
var scriptAbsolutePath = app.getAppPath() + '/app/components/scripts/scriptname.sh';
var ls = spawn('sh', [scriptAbsolutePath]);
You can also have a look at app.getPath(name) API if it satisfies your particular requirement.

Use relative path in Firefox extension

I develop Firefox extension with bundled executable file which should be run on browser startup.
To run process I need get nsIFile or nsILocalFile instance which points to executable file.
I know one solution how to get it using directory service:
var file = Components.classes["#mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile);
file.append("extensions");
file.append("<extension id>");
file.append("<relative path>");
But this solution has two disadvantages:
It doesn't work in development mode, when instead of installed extension I have only text file with real extension path
I'm not sure that it will work on all Firefox configurations because of hardcoded "extensions" part of the path
So is there any nicer way to run executable file which comes with Firefox extension?
Thanks.
You are making way too many assumptions about the directory structure of the Firefox profile - don't. The Add-on Manager API lets you get the path of a file inside the extension, you should use it:
Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonByID("<extension id>", function(addon)
{
var uri = addon.getResourceURI("<relative path>");
var file = uri.QueryInterface(Components.interfaces.nsIFileURL).file;
...
});
A restartless addon's startup function (in the bootstrap.js file) will receive, as its first parameter, the path where the addon is installed. You can then play various tricks to read files inside the .jar file, if any: see https://github.com/protz/GMail-Conversation-View/blob/master/bootstrap.js#L55 as an example.
In a non-restartless case, I must confess I don't have much of an idea :).
I found this thread looking for a way to reference a path to an image hosted in extension's directory from a content script. Here's a solution:
Include your files in web_accessible_resources in the extension's manifest.
"web_accessible_resources": [
"images/*"
]
Absolute paths to these resources contain randomly generated UUID, therefore we're using runtime.getUrl() giving it the path relative to manifest.json. Example:
let myImg = document.createElement('img');
myImg.src = browser.runtime.getURL("images/my-img.png")

Rails 3.1+ and GeoIP database file location/access

This question is related to Rails - Where I have to store data file (.dat) in my rails project - GeoIp City database . I have a rails 3.2 app. I am trying to run:
#geoip = GeoIP.new('GeoLiteCity.dat')
In one of my app's controllers. I unzipped the 'GeoLiteCity.dat' file into the /public folder. I am getting the error "No such file or directory - GeoLiteCity.dat".
I've experimented with putting it in the images assets pipeline folder and some random other places. I continue to get the same error. Not sure how to access this file. Any ideas on what I'm doing wrong or how to access it best with the assets pipeline?
Try referencing it via the full path:
#geoip = GeoIP.new("#{Rails.root}/public/GeoLiteCity.dat")
On a side note, it's probably not a big deal, but I wouldn't put the file in your public directory.

Resources