span8
span4
span8
span4
This example demonstrates the FME Server Data Download service and the power of integrating it with web maps such as Google Maps and ArcGIS Server.This example application provides an interface for the user to select a study area by drawing a polygon.Once the polygon is drawn, the user can continue building up a request by selecting the layers they wish to download and the format and the coordinate system of the returned data.The request is then sent to FME Server which processes it and returns the data to the user.
Web Map Data(contains web map files, geodatabase and workspace)
The example has several notable features:
The workspace and all of the code is available fordownload from GitHub.
After you download the source files for this demo, you will need to complete the following steps to configure it to run with your own FME Server installation.
1.Upload the source dataset
Log into the FME Server Web User Interface, browse to the Resources menu, then to the data folder within the Resources.Once there, click Upload in the upper right corner and select the transit.gdb geodatabase.
Upload the Transit.gdb to the Data folder under Resources in FME Server
If you are using Chrome, choose the option to 'Upload Folder' and upload the Transit.gdb dataset.If you do not have access to Chrome, put the Transit.gdb dataset into a zip file first, then choose the option to 'Upload File' and upload the zip file with Transit.gdb inside.
2.Change source parameters in the DataDownloadService.fmw workspace
In FME Workbench, open the DataDownloadService.fmw, which can be found within the fme folder in the downloaded files.
Open up the Feature Reader parameters, and adjust the dataset to point to the Transit.gdb file that you uploaded to FME Server.
If you uploaded the dataset as a folder, change the path to the following:
$(FME_SHAREDRESOURCE_DATA)Transit.gdb
If you uploaded a zip file containing the geodatabase, use the following path instead:
$(FME_SHAREDRESOURCE_DATA).zip/Transit.gdb
FeatureReader parameters, ensure the Dataset is set to $(FME_SHAREDRESOURCE_DATA)Transit.gdb (or the zip file variation)
3.Publish to FME Server
保存更改 made to the workspace, then click File > Upload to FME Server.In the Publish to FME Server wizard, set your connection parameters, see thisarticlefor information on how to do this.
On the second page of the Publish to Server dialog, select a repository and name for the workspace you are publishing.Take note of the repository and workspace name you use as you will need this information when changing the javascript files in Step 6.
Complete the Publish to Server wizard making sure to register the workspace with the Data Download Service and the Job Submitter Service.
4.Move Directory Files
复制“www”文件夹从下载包 a web-accessible ROOT location.It can be hosted by a web server like IIS or Apache.Additionally, you could make use of a service like Amazon S3 to host the page.To learn more about web hosting and FME server check out thisarticle.
Note: If you are using FME Server on premises, you can host the web page from its web server root directory.Although this method isn’t recommended for security reasons, it is an easy way to get this demo up and running while a more secure method is developed.Copy the ‘www’ folder into
5.Set up an FME Server Token
We need to set up an FME Server Token to be able to connect the javascript with an FME Server.To create a token go to the FME Server Web User Interface, and in the top right corner, click on your username to open the menu drop-down then select Manage Token.
In the Manage Token dialog, click on New Token to open up the parameters, enter your Username and Password, then change your duration to however long you would like this token to be active, for this example, the token is set to 30 days.You can then also choose to reuse the token, this is a good idea if you have already created a token and are using it somewhere else.For more information on FME Server Tokens visit thedocumentation.Copy this Token for use in Step 7.
创建和复制一个FME服务器令牌用于实施步骤7
6。修改JavaScript,以点到存储库和工作区
Open the following file as an Administrator in a text editor: \www\js\datadistribution.js Ensure that you are opening it from the ROOT folder hosted by your web server.
Under the dataDist function, change the repository and workspaceName variables to point to your own FME Server installation.
修改资料库工作区名,并以反映您的工作空间信息
7。修改JavaScript来点你的FME Server和令牌
Next, we will modify the dataDist.init function parameters.Comment out (by adding // before each line) or delete the following 3 lines if you would like to use your own FME Server parameters:
注释掉或删除运行我们的现场演示输入自己的参数的JSON线
Then un-comment (delete //) to enable the following 3 lines, then modify the Server and Token variables to reflect your FME Server name and the Token that was copied in Step 5.
当你第一次下载该数据,这部分代码将被注释掉,删除//使其生活。
8。保存更改
保存更改 you made to datadistribution.js, if you get an error when saving the javascript file, ensure that you opened your text editor as an Administrator.
9。建立CORS(仅在使用自己的Web服务器主机)
You only need to complete this step if you are using your own web service (Apache, IIS, S3) to host your demo.Back in the FME Server Web User Interface on the side menu bar, click onCORS.Once you are on the Configure Cross-origin Resource Sharing (CORS) page, in the top right corner click on Load Template, then click on Allow All Hosts.For the more advanced user, you can set up Specific Hosts.
建立CORS在FME Server如果在外部服务器上托管你的网络地图。
10。运行演示
To run the live demo, enter the following URL into a web browser and input your FME Server name:
谷歌地图 Background:
http:///www/index.html?map=google
Esri ArcGIS Background:
http:///www/index.html?map=arcgis
注:此URL假定您会将整个的“www”文件夹到你的Web服务,相应地更改URL如果文件夹或文件的名称已更改。
故障排除
If you load the demo and do not see your parameters, or nothing happens when you create a polygon.Double check that you loaded the demo using the URL and not by just opening the HTML file.If you opened the demo correctly, right-click anywhere on the page and open the Developer Tools/Inspect, then check the Console for any error messages, usually, it is just a case of CORS not being set up correctly.
检查您的网址或开发者控制台,以确定为什么你的参数不工作。
更多信息有关部署网站
使用GitHub上,AWS S3,部署和FME云一个简单的Web应用程序体系结构
数据归属
The data used here originates from open data made available by the温哥华市, British Columbia.It contains information licensed under the Open Government License - Vancouver.
我已经尽了自己的服务器(2015年)就这样做,我可以得到的网页与地图加载了,我可以绘制多边形但参数框出现空的,所以我不能选择的主题,CRS或格式和 therefore it fails.谁能帮助?
你好@ baznewman07有此可能发生的几个原因,但在几乎所有情况下,你应该能够看到错误消息来了,如果你使用的开发工具,在Web浏览器看的请求由web应用程序正在进行 your Server.如果不帮助你缩小的原因,请随时通过支持与我们联系www.亚搏在线safe.com/supportrequest我们可以帮你仔细看看这个。
劳拉,我有现在的工作,我甚至已经设法用自己的地图服务,而不是谷歌或ESRI。我对你的问题,虽然,我可以用这个与数据流的服务呢?例如,当我打我的请求能得到的数据进行拟定在屏幕上,而不是它的映射被放入一个下载链接?这将是,如果我能真正有用的。
嗨,
我有这个例子我自己的数据和所有的工作非常出色的工作。今天的背景地图谷歌不再出现,虽然ESRI的选择仍呈现。您的演示网站似乎并不具有相同的问题。你知道,如果我需要更新的HTML代码的链接https://maps.googleapis.com在某种程度上,如果我打开开发工具的所有错误涉及googleapis,我没有改变任何东西它停止工作,所以我不知道这个问题的根源做。一切还在工作,我可以下载数据我不能看到背景地图!
谢谢
你好,
你仍然有这样的烦恼?有一件事我建议是尝试使用来自谷歌的网站的一个例子,看看是否适合你,然后比较什么是在那里发生的事情是什么在页面发生显示错误,这可能有助于缩小的原因 of the trouble:https://developers.google.com/maps/documentation/javascript/examples/map-simple
嗨@yakker。我会尽量给你与同事交流。如果我理解正确的话,你下载的源文件本演示,以及完成的步骤将其配置为与自己的FME Server安装运行。然而,问题是,你没有一个内部网络服务器?
你好@yakker,
您将需要一个Web服务器能够运行,如果你直接打开HTML文件将无法正常运行这个HTML文件。如果你只是需要一些东西来测试这一点,我已经找到了一个很好的快速和简单的方式来获得一个内部Web服务器暂时运行的使用Python。这里有一些信息:https://docs.python.org/2/library/simplehttpserver.html
我通常只是运行命令
蟒蛇-m SimpleHTTPServer 8000
从在HTML页面所在的目录,在命令行。在Web浏览器8000:然后可以使用HTTP测试:\\本地主机。
Create Self-Serve Access to Data with FME Server
Create specific directory structure in the Data Download ZIP file
Including additional files in the data download result zip file
How do I dynamically generate options for a published parameter?
Data download results are not written to the defined directory
Workspace with FMEServerJobSubmitter Fails with Licensing Error
Data Upload Part 2: Custom Pages (2015)
© 2020 Safe Software Inc |Legal