Topojson command on .shp file not working? - makefile

thanks for reading this; I could use some help.
I read this article, it is about creating a makefile to convert a topojson file from a .shp file. I am following the steps contained in downloadable Makefile available whithin the article's link, however I simply can't get to create the .json file; it just doesn't appear. These are the steps I am trying to replicate:
curl -o counties.zip 'http://www2.census.gov/geo/tiger/GENZ2010/gz_2010_us_050_00_20m.zip'
unzip counties.zip
touch gz_2010_us_050_00_20m.shp
topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp
Step 4 is simply not working. I have no reason to think topojson is not properly installed, although I have never been able to create a topojson file. What could be wrong?
After downloading the Makefile and executing it in order to convert the topojson file the following message is displayed in the terminal:
topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp
make: *** [counties.json] Error 1
These are some of my PC's specifications:
I am running Ubuntu on Oracle virtualbox v4.3.26, my main OS is Windows 8 64 bit.
Intel Celeron 1.90 GHz
4.00 GB Ram.
Thank you very much for your help in advance.

Process validation
Your / The following commands are correct :
curl -o counties.zip 'http://www2.census.gov/geo/tiger/GENZ2010/gz_2010_us_050_00_20m.zip'
unzip counties.zip
touch gz_2010_us_050_00_20m.shp
topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp
Running it is successful :
Visualisation is fine :
File is visible, to inspect, and downloable there, on jsoneditoronline.org.
Way to go
Did you ever produced a single topojson file via the command line topojson script ? If not, I guess topojson is either not installed or corrupted. There is a common issue with some dependency. I advice you to uninstall topojson, then to reinstall it.
Bug repporting
Please report the error message you get when running topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp without makefile. So we get a topojson or npm error, not the make error.
Next
Search for "how to install topojson + bug". Example : Trouble installing topojson on ubuntu

Related

transcrypt issue - cannot run the sample program

Followed the instructions in transcrypt "getting started" docs, I entered the examples 'hello.html' and 'hello.py' in a separate directory.
Entering from the command line: "transcrypt -b -m hello.py" resuleds in the error message: "'transcrypt' is not recognized as an internal or external command,
operable program or batch file."
I'm using python3.6, with transcrypt installed in: C:\program files\python36\lib\site-packages\transcrypt
Any help to activate the sample hello.html would be appreciated.
Could you try python -m transcrypt -b -m hello.py
and tell me what the console output is?
Also: are you on Windows, Linux or OsX?
Answer: Windows 10
[EDIT 1]
Looks like Transcrypt was installed under a different Python distro. Would be good to know what's going on, so please keep us informed. I also have several Python installs on my Windows 10 computer and it can be confusing indeed.
[EDIT 2]
Another possibility is manual installation (although it isn't elegant...). From the docs
http://www.transcrypt.org/docs/html/installation_use.html#installation-troubleshooting-checklist
Alternatively, for manual installation under Windows or Linux, follow
the steps below:
Download the Transcrypt zip and unpack it anywhere you like
Add ../Transcrypt-/transcrypt to your system path
To enable minification, additionally the Java Runtime Environment 6 or later has to be installed
Note If you install Transcrypt manually, Trancrypt is started by typing run_transcrypt rather than transcrypt. This allows a pip
installed Transcrypt and a manually installed Transcrypt to be used
side by side selectively
BTW Thanks for the suggestion on Github. We'll look into it and try to improve the docs on this point. It seems to be quite difficult to really draw up a bullet proof installation procedure for each platform.
You might also find it easier to use python3's built in virtual env, so that you install Transcrypt and other python modules only into one project folder at a time. It's much easier to use than it at first sounds.
Here's how you might do that on Windows 10.
mkdir mynewproject
cd mynewproject
py -3 -m venv myvirtualenv # installs venv files into myvirtualenv
myvirtualenv\Scripts\activate # activates the virtual env
The py -3 command uses the python windows launcher to use the latest version of python 3. The launcher is defined in Pep 397 and the docs are here.
Once the virtual environment is activated, the prompt will change to show that. After which any 'pip install' commands will install packages into 'myvirtualenv', instead of the system wide location. If you want to deactivate it, just type 'deactivate' or close the shell window. You can also just use 'python' to refer to python3 from within the virtual env. This has saved many people from madness.
In case this helps for other newbies. A few problems I encountered when setting up transcrypt.
Path issues: I had multiple versions of python, in different folders: \python26, \python27, and \Program Files\python36.
This caused all sorts of grief, despite setting the environmental path to include the python36 distro. I fixed this issue by renaming the other versions \python26x and \python27x. This left those distros intact if ever I needed to use them, but stopped the system from finding them. Thus, it only found python36
My earlier suggestion of py -3 didn't really solve the multiple distro issue completely after all.
After doing that, I reinstalled transcrypt and it seemed OK (sort of: read on)
Second issue was trying to run the sample hello.py. I tried "transcrypt -b hello.py" and got a "'transcrypt' is not recognized.." message.
But this worked: python -m transcrypt -b -m hello.py
That worked because the system had finally found the correct version of python, due to the above fix.
Similarly, trying to run the sample hello.py as recommended in the docs caused a problem. run_transcrypt -b hello.py
The reason for this was that run_transcrypt resolved to "python $(dirname $0)/main.py $*"
But, because I had python v3.6 installed in c:\Program Files, the batch file run_transcrypt caused this output:
c:\transcrypt>python C:\Program Files\Python36\Lib\site-packages\transcrypt__main__.py -b hello.py
python: can't open file 'C:\Program': [Errno 2] No such file or directory
Consequently, I had to place Program Files in quotes and run it this way:
"C:\Program Files"\Python36\Lib\site-packages\transcrypt__main__.py -b hello.py
or else, as above: python -m transcrypt -b -m hello.py
I think, with respect, the docs should raise a warning flag here for users who have python installed in \Program Files, rather than, for example, in c:\python[x]
Third issue Changing hello.py to "play around" with the code -
I found the files in transcrypt\demos\ to be read-only. To fix this:
1: I opened the command prompt as administrator
2: I ran the attrib command to change the file attributes:
"c:\Program Files\Python36\Lib\site-packages\transcrypt\demos\hello>attrib -r -s -a hello.py"
(Without doing this as administrator you get an access-denied message)
The whole exercise caused a few hours of toing and froing, but it seems that things are better now.

Trouble with tutorial on getting started with Webassembly

I'm following the guide here for creating a Hello World wasm application (Mac OS). I followed everything to a T, and am sure git and python are in my PATH, and 90% sure cmake is in my path. The installations were long but went fine. When I type the command emcc hello.c -s WASM=1 -o hello.html into my terminal, however, I receive the message -bash: emcc: command not found. Tried to sudo it too.
Not sure what the issue is. I'm obviously extremely green to wasm. Thanks!
The page you linked shows the command needed to add relevant environment variables and directory entries to PATH. On Mac the command would be:
source ./emsdk_env.sh

Error in LeNet on MNIST example

I followed the guidance under the Training LeNet on MNIST with Caffe but I've got a error when creating lmdb..
$ ./examples/mnist/create_mnist.sh
Creating lmdb...
F:/program files/caffe/build/examples/mnist/convert_mnist_data.exe:
error while loading shared libraries: boost_python-vc140-mt-1_61.dll: cannot open shared object file: No such file or directory
I'm using GIT Bash for run the shell script,
so what is wrong?
It appears that the linker/loader does not have access to that Python BOOST library. Did you run the scripts needed to set your environment variables? I suspect that there's a missing path in your LD_LIBRARY_PATH.
As a stop-gap, you can locate the missing file with
find / -name boost_python-vc140-mt-1_61.dll
... and then manually add that path to LD_LIBRARY_PATH. The problem is that you'll hit thesefiles/caffe/build/examples/mnist/convert_mnist_data.exe one at a time until you get them all.
You can also try
ldd files/caffe/build/examples/mnist/convert_mnist_data.exe
... and see what you might be missing.

how to edit existing debian package in installation cd?

ive been trying to edit a Debian installation CD,
followed tutorial on debian website
https://wiki.debian.org/DebianInstaller/Modify/CD,
successfully extract cd, use genisoimage to recreate iso, try to install debian, no problem.
and then the problem, when i tried to edit one of the package, say i want to change a picture in a package .deb, i used this command:
extract .deb:
mkdir directoryname
cd directoryname
dpkg-deb -x pathtopackage/package_name.deb .
dpkg-deb -e pathtopackage/package_name.deb
building .deb :
dpkg-deb -b . pathtopackage/new_package_name.deb
and replaced the very same package on /pool/main debian cd directory
however after built the iso, it failed to install my edited package,
i've tried to fix md5 sum inside cd, rebuild dist/Release, still no luck.
any advice?
thanks in advance
finally did it.
first mistake
building .deb :
dpkg-deb -b . pathtopackage/new_package_name.deb
correct command:
dpkg-deb -b -Zgzip . pathtopackage/new_package_name.deb
to recreate exact package as original one
and then following the rest tutorial on https://wiki.debian.org/DebianInstaller/Modify/CD,
except for debootstrap error, it can be done by following tutorial from this page
https://bugs.launchpad.net/ubuntu/+source/debootstrap/+bug/1001131
edit my debootstrap.deb, repackage, and voila, done all the works.
apparently my error was because debootstrap error from official debian page doesnt work for me.
hope this information useful for anyone

an error in plone theming

I installed Plone 4.1.3 and I am trying to make a theme. I saw this link talk about this issue:
http://www.treebrolly.com/blog/turbo-plone-theming-with-xdv-diazo
and I followed the commands. When I run this command
$ ./bin/instance fg
it says
Error: error opening file /home/hosam/plone413/zinstance/parts/instance/etc/zope.conf: [Errno 2] No such file or directory: '/home/hosam/plone413/zinstance/parts/instance/etc/zope.conf'
For help, use ./bin/instance -h
hosam#hosam-desktop:~/plone413/zinstance$
I noticed that when I run this command
$ ./bin/buildout -c demo.cfg
this directory and its contents are deleted /home/hosam/plone413/zinstance/parts/instance/
and so this error appears to me, Any can help??
When you run :
$ ./bin/buildout -c demo.cfg
the parts folder is supposed to be deleted and rebuilt (that's fine).
The error you are facing says that this command doesn't end correctly. Try to add the -v parameter
$ ./bin/buildout -v -c demo.cfg
so you will have a more verbose output and you can provide here a complete error traceback
Set up your demo.cfg in a different buildout directory. Looking at the blog entry you mentioned, it's meant to standalone, not share the same buildout directory with a zope/plone instance.
You might want to consider using plone.app.theming instead of XDV. The big difference is that plone.app.theming runs inside Plone and doesn't require any separate build. That really simplifies things if you don't need to mix in content from non-Plone sources.

Resources