Monday, January 30, 2017

seaweedfs

CMD,

cd C:\jh1\seaweedfs\



--------------------
start server, default port 9333#

weed master

----------------------------
start 2 volume as port 9331, 9332#

weed volume -dir="C:\jh1\seaweedfs\data1" -max=5  -mserver="localhost:9333" -port=9331 &
weed volume -dir="C:\jh1\seaweedfs\data2" -max=10 -mserver="localhost:9333" -port=9332 &

----------------------
upload a file#


C:\Users\HU_J>curl -X POST http://localhost:9333/dir/assign

{"fid":"6,01d1e2347c","url":"127.0.0.1:9331","publicUrl":"127.0.0.1:9331","count
":1}


> curl -X PUT -F file=@C:\jh1\share_map_online\desktop_map_export\pdf\CDBG_2015_1.pdf http://127.0.0.1:9331/6,01d1e2347c


> curl -X PUT -F file=@"C:\jh1\share_map_online\desktop_map_export\pdf\City of Costa Mesa Zoning Map 2017.pdf" http://127.0.0.1:9331/7,022fde80fd




C:\Users\HU_J>curl -X POST http://localhost:9333/dir/assign
{"fid":"6,01d1e2347c","url":"127.0.0.1:9331","publicUrl":"127.0.0.1:9331","count
":1}
C:\Users\HU_J>curl -X PUT -F file=@C:\jh1\share_map_online\desktop_map_export\pd
f\CDBG_2015_1.pdf http://127.0.0.1:9331/6,01d1e2347c
{"name":"CDBG_2015_1.pdf","size":2652865}

------------------------

read file

http://localhost:9331/6,01d1e2347c
http://localhost:9331/7,022fde80fd

Friday, January 27, 2017

gridFS






-d means your database,
-l means your local file system path to the file you will upload
put means you want to upload a file
CDBG_2015_1.pdf means the file name in GridFS( Not your local file system path )
 mongofiles -d civilpdf -l  C:\jh1\share_map_online\desktop_map_export\pdf\CDBG_2015_1.pdf put CDBG_2015_1.pdf
Then you could search file by keyword "CDBG"
mongofiles -d civilpdf search CDBG
You could download file to a whatever place you like as
mongofiles -d civilpdf -l "C:\your liked whatever place"  get CDBG_2015_1.pdf


=======================================

in cmd for file path, you can  use double quote "C:\jh1\share_map_online\desktop_map_export\pdf\pdf_to_jpg\City of Costa Mesa Zoning Map 2017.pdf"

if there is space or other special char,


----------------------------------------------------------------

mongofiles -d civilpdf list

mongofiles -d civilpdf search CDBG

mongofiles -d civilpdf get community_improvement_division_2017_Jan_18.pdf
mongofiles -d civilpdf get CDBG_2015_1.pdf



mongofiles -d civilpdf -l C:\jh1\share_map_online\desktop_map_export\pdf\CDBG_2015_1.pdf put CDBG_2015_1.pdf
mongofiles -d civilpdf -l C:\jh1\share_map_online\desktop_map_export\pdf\community_improvement_division_2017_Jan_18.pdf put community_improvement_division_2017_Jan_18.pdf
mongofiles -d civilpdf -l "C:\jh1\share_map_online\desktop_map_export\pdf\City of Costa Mesa Zoning Map 2017.pdf" put "City of Costa Mesa Zoning Map 2017.pdf"


mongofiles -d civilpdf -l C:\jh1\share_map_online\desktop_map_export\pdf\pdf_to_jpg\CDBG_2015_1.pdf get CDBG_2015_1.pdf
mongofiles -d civilpdf -l C:\jh1\share_map_online\desktop_map_export\pdf\pdf_to_jpg\community_improvement_division_2017_Jan_18.pdf get community_improvement_division_2017_Jan_18.pdf
mongofiles -d civilpdf -l "C:\jh1\share_map_online\desktop_map_export\pdf\pdf_to_jpg\City of Costa Mesa Zoning Map 2017.pdf" get "City of Costa Mesa Zoning Map 2017.pdf"


Wednesday, January 18, 2017

split multipolygon

ArcMap, arctoolbox -> data management -> features -> Multipart to singlepart
Qgis, vector menu -> Geometry tools -> Multipart To Singlepart.
arcmap, No advance license need,


Friday, January 13, 2017

node.js express.js tips


>nodemon app.js
============================
Sick of restarting your server?
So far, when you change your code, you have to stop your server and start it again.
This can get repetitive! To alleviate this problem, you can install a tool called nodemon,
which will watch all of your files for changes and restart if it detects any.
You can install nodemon by running npm install nodemon --global.
Once it’s installed, you can start a file in watch mode by replacing node with nodemon
in your command. If you typed node app.js earlier, just change it to nodemon app.js,
and your app will continuously reload when it changes.