There is no output.las created using a PDAL pipeline via JSON to transform the input.laz file - output

I am using Mini forge and have PDAL installed in my computer.
I cannot get the PDAL to output the output.las file .
If I create an empty las file for the output , nothing happens and if I don't create it in the directory there is an error.
this is my line in the mini forge command prompt:
pdal pipeline autzen.laz shape-clip.json.
The input laz file is fine , I have viewed it using cloud compare.
Here is the code for the shape-clip:
[
{
"type":"readers.las",
"filename":"C:\\Users\\502011\\OneDrive - Amey plc\\Documents\\Programming\\Python\\Point Cloud Processig Project\\PDAL tutorials\\Point_cloud_Data.las"
},
{
"type":"filters.overlay",
"dimension":"Classification",
"datasource":"attributes.vrt",
"layer":"OGRGeoJSON",
"column":"CLS"
},
{
"type":"filters.range",
"limits":"Classification[5:5]"
},
{
"type":"writers.las",
"filename":"C:\\Users\\502011\\OneDrive - Amey plc\\Documents\\Programming\\Python\\Point Cloud Processig Project\\PDAL tutorials\\output.las"
}
bearing in mind I added the type recently before I had this:
[ input.laz
{----},
{======},
etc
,
output.las
]
i've also tried to no avail:
[ input.las
{----},
{======},
etc
,
output.las
]
whats the issue here ?
I was expecting the input las to be transformed and clipped with a section of its point cloud saved to the output.las file.

Related

Autodesk Forge Viewer is not rendering SVF derived from IFC

IFC model has been uploaded and translated to SVF.
the problem is reproduced on https://autodesk-forge.github.io/forge-tutorial-postman/display_svf.html. The viewer is rendering forge logo indefinitely. The console shows an error:
"TypeError: undefined is not an object (evaluating 't.children.length')"
We are experiencing this since Tuesday, 26 Oct, 2022 06:45 AM (GMT).
This is the body of the Translate Job Post API:
{
"input": {
"urn": "{{t4_ossEncodedSourceFileURN}}"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d", "3d"
],
"advanced": {
"conversionMethod": "modern",
"buildingStoreys": "show",
"spaces": "show",
"openingElements" : "show"
}
}
]
}
}
The same model is successfully presented when translated to SVF2.
We tested this executing multiple scenarios using multiple models.
Using postman collections, both versions with signedcookies and without show the same behavior.
In our system , we are translating models to SVF and downloading derivatives to serve those from our own servers. The same behavior is noticed there. We are using forge-server-utils version 8.3.4 for download
Also, vscode-forge-tools Visual Studio Code extension shows the same behavior.
Models translated before the date indicated above are rendered correctly.
Kindly asking for help, this has a big impact on our service.

Getting a strange parse error for JSON uploaded to Google Cloud storage

So, I'm doing some testing of google cloud storage access. I am trying to manually upload a json file (via the console) that I will programmatically change. But Google doesn't seem to like my json file. The beginning of the file looks like:
{
'mlsid': "MD-BRIGHT",
'mlsno': "1000000300",
'maxres': "2x",
'modified': "20180201133459",
'count': 28,
'photos': {
'org': [
{
'uri': "https://storage.googleapis.com/idx-photos-gs.ihouseprd.com/MD-BRIGHT/1000000300/org/000.jpg",
'width': 625,
'height': 768
},
. . .
Which looks correct to me, but when I try to open the file in a window from the GCS control panel, it displays this error:
Error: Parse error on line 1:
{ 'mlsid': "MD-BRIGHT"
-----^
Expecting 'STRING', '}'
I mean, isn't 'mlsid' a string? I have tried it with both single and double quotes. Quite baffled.
Valid JSON requires double-quotes and not single-quotes for keys and strings.
{
"mlsid": "MD-BRIGHT",

export whole Neo4j database / cypher result to GraphJSON

I´ve already had a look at different post like this and this but nothing seems to be answered 100%.
My current problem is, that I want to visualyze - and ideally - analyze my Neo4j-Graph with a library (or software/tool).
The database-server is running on a remote (virtual) server and it seems that there is no chance to export the database to a format where I can work on with.
I´ve tried exporting the graph in a .graphml-file to import this file in Gephi, but Gephi doesn´t find the properties. Gephi-streaming with apoc-procedures and the graph-streaming plugin also does not work, because it´s a remote server (also with the tool mentioned here).
Now I´m currently testing around with Alchemy.js... So far, so good. But as it seems there´s no way to export the graph/query to the GraphJson-format?
Is there really no "easy" way to export the data?
Thanks for your help in advance!
This is how I would proceed
Run this query from the post you mentioned in the Neo4j Browser or in any bolt driver:
MATCH (a)-[r]->(b)
WITH collect(
{
source: id(a),
target: id(b),
caption: type(r)
}
) AS edges
RETURN edges
Now that you have loaded the data, you can simply download it as JSON using download button.(if you are using bolt driver ignore)
Either you manually downloaded JSON from Neo4j Browser or you are using bolt driver, you will end up with something like this.
{
"columns": [
"edges"
],
"data": [
{
"row": [
[
{
"source": 31288,
"target": 152,
"caption": "HAS_PAYMENT_METHOD"
}
]
],
"meta": [
null
],
"graph": {
"nodes": [
],
"relationships": [
]
}
}
]
Now all you have to is to filter out data.row results and you are done. Probably using bolt driver is the better choice as you have to clean up data anyway and it doesnt run into issues with returning a lots of data to the browser(it might crash).
Update: added python version
from neo4j.v1 import GraphDatabase
driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "neo4j"))
session = driver.session()
result = session.run("MATCH (a)-[r]->(b) WITH collect({source: id(a),target: id(b),caption: type(r)}) AS edges RETURN edges")
for record in result:
print(record["edges"])
Hope this helps

How to export large dataset collection of mongodb to CSV file on button click via node express

I have db contain large dataset - json objects - (array) around ~10k i have for now. I want to to fetch all from db and generate csv and download via route..
Here's sample json object:
{
"_id" : ObjectId("56bc3a7da30befd952349542"),
"asin" : "B00T2Q1S18",
"searchRank" : 113,
"name" : "FREEing Racing Miku 2014 (EV Mirai Version) Figma Action Figure",
"createdAt" : ISODate("2016-02-11T07:38:37.774Z"),
"updatedAt" : ISODate("2016-02-11T07:44:07.667Z"),
"linkIds" : [
"25b1071a9e908806338c4106"
],
"price" : {
"amazon" : 50.49
},
"ranks" : [
{
"number" : 43619,
"category" : "Baby Toys"
}
],
"upc" : ""
}
Is there any better npm (node) library which can converts my json collection to csv..
Though I have tried those but on large dataset they aren't working.
papaparse / babyparse
json2csv
Is there any other libs that you know better or any other better approach?
Thanks.
I have done this before using an npm library called csv-builder. Based on my experience I can say that it gives good performance and It is quite easy to implement.
I have made a CSV of about 2 LAC rows and around 8-10 columns,with manipulation in between using this library.
I tried with many libs and at last I found one - a great npm module which handles large dataset problem nicely....
https://www.npmjs.com/package/csvwriter
exported upto 5 lacs + json objects (for now)..
Here is my small demo large dataset json to csv exporter app via node, express, mongodb
Hope this helps others as well, when they come over here.
Cheers,
Thanks.

How to indent JSON data inside of TextMate, Emacs, BBEdit, or Sublime Text 2?

[Update: 8 hours after this question was posted, the author of JSON bundle was notified of the issue and he fixed it.]
I have the following JSON data in a file application.json, shown at the end of this post, and I have used TextMate with the JSON bundle, Emacs, BBEdit, and Sublime Text 2 to properly indent it, but all seemed like they couldn't.
Both TextMate and Sublime Text 2 insisted that the first { should not be indented, and the first major issue was for the closing brace for "child": {. Both TextMate and Sublime Text 2 refused to align the } under the left side of "child": {. Emacs kept on indenting further and further for each line, and BBEdit didn't seem to have an re-indent function at all (could this be?).
Is there a way to properly indent the file, or are TextMate and Sublime Text 2 both doing the right thing for the JSON data?
[
{
"settings": [ "master" ],
"appPort": "8666",
"specs": {
"frame" : {
"type" : "HTMLFrameMojit",
"config": {
"deploy": true,
"child": {
"type" : "HelloWorldMojit"
},
"assets": {
"top": {
"css": [
"/static/HelloWorldMojit/assets/index.css"
]
}
}
}
}
}
},
{
"settings": [ "environment:development" ],
"staticHandling": {
"forceUpdate": true
}
}
]
EDIT: For BBEdit use siegel's suggestion of Text > Reformat Document
Original Reply:
I found a solution for BBEdit that is easy and works well.
Put the following script in
~/Library/Containers/BBEdit/Data/Library/Application Support/BBEdit/Text Filters/FormatJSON.sh (on MacOS 11 Big Sur, or above)
For MacOS 10.15 Catalina and below, use this location: ~/Library/Application Support/BBEdit/Text Filters/FormatJSON.sh
#!/bin/bash
python -m json.tool
Open a JSON file in BBEdit. There is no need to restart BBEdit because BBEdit rocks!
Select Text > Apply Text Filter > FormatJSON
I tested this with a JSON file that had 3,612,683 characters on a single line. BBEdit opened this file and reformatted without showing a "Spinning Beachball of Death" busy-wait mouse cursor.
Solution 1: Using Python
This answer is similar to this answer, except I am using python file to do the JSON format.
Exit bbedit application if it is open,
put following script pretty-json.py in ~/Library/Application\ Support/BBEdit/Text\ Filters/ path
#!/usr/bin/env python
# You can change above she-bang line depending on your Mac configuration
import sys
import json
def main():
input = sys.stdin.read()
try:
obj = json.loads(input)
except Exception as e:
print input + "\n\nERROR: " + str(e)
return 1
print(json.dumps(obj, indent=2))
return 0
if __name__ == '__main__':
sys.exit(main())
To Test, open a JSON file in BBEdit.
Select Text --> Apply Text Filter --> pretty-json.py
If you face any issue like formatting error, then the above script will add error in New file and will not change the original JSON.
which is not the case with this answer
Ref: https://gist.github.com/brokaw/95ade1358954cd97d0f2c8e992e14b08
For more info: Refer this
The above filter works fine for smaller JSON files, but if the JSON file is large(~ 40MB) then formatting will be slow.
To solve this, use the following solution
Solution 2: Using jq
For faster json formatting,
Install jq brew install jq
Check if you are able to execute jq in terminal, or need a full path, add whichever works in following file in place of jq
Add fast-json-pretty.sh file in ~/Library/Application\ Support/BBEdit/Text\ Filters/ location
Restart bbedit.
#!/bin/bash
jq
In BBEdit 14.0 and later, "Reformat Document" on the text menu will reflow JSON. You can also use the built-in Language Server Support with a JSON language server that supports reformatting.
I just corrected this issue in the bundle, for 2.0 users the bundle should update within 24 hours with the correction.
According to http://jsonprettyprint.com/ Textmate and Sublime aren't doing the right thing.
What version of Emacs did you use?
With 24.2.1, your JSON blob indented perfectly without issues in js-mode (Emac's default javascript major-mode).
If you do any significant Javascript development I recommend checkint out js2-mode https://github.com/mooz/js2-mode, which turns Emacs into a great JS IDE.
Sublime Pretty JSON
Sublime Pretty JSON indents the first { well.
This is what I get:
[
{
"settings": [
"master"
],
"appPort": "8666",
"specs": {
"frame": {
"type": "HTMLFrameMojit",
"config": {
"deploy": true,
"child": {
"type": "HelloWorldMojit"
},
"assets": {
"top": {
"css": [
"/static/HelloWorldMojit/assets/index.css"
]
}
}
}
}
}
},
{
"settings": [
"environment:development"
],
"staticHandling": {
"forceUpdate": true
}
}
]
Installation
Within Sublime Text 2: Preference => Package Control => Install Package => "Pretty Json" => Restart Sublime => Select JSON Text => Press:
Linux: ctrl+alt+j
Windows: ctrl+alt+j
OS X: cmd+ctrl+j
This is a solution simply using Google Chrome or NodeJS itself, and here is how:
Just open up the Google Chrome dev tool or NodeJS prompt, and type in
obj =
and copy and paste the object into it, so it will be like
obj = [
{
// etc
Now, in Google Chrome, just type
JSON.stringify(obj, null, 4)
and you will have the formatted JSON. In NodeJS, since it prints out the \n verbatim, you can use
console.log(JSON.stringify(obj, null, 4))
If you want the indentation to be just 2 spaces, just use 2 instead of 4.
If you want the indentation to be tabs instead of spaces, simply use
JSON.stringify(obj, null, "\t")
Create a script file fast-json-pretty.sh in ~/Library/Application\ Support/BBEdit/Text\ Filters/
Insert the following script:
#!/usr/bin/env bash
/usr/local/bin/jq .
Apply the text filter as follows: Menu bar --> Text --> Apply Text Filter --> fast-json-pretty
This is a reworked version of DKB's version of his JQ script as it, at least for me, required the full path and a dot (.) at the end to make this work.
Just check to see which version of python is installed:
using json_pretty will only work if the python interpreter is whatever is installed in the shell being called. For example, my json_pretty works and I have modded it as follows on Ventura:
#!/bin/zsh
python3 -m json.tool