Neo4j spatial server plugin fails on withinDistance and closest java.lang.NoClassDefFoundError - graph

I know that the plugin is being loaded properly, as other methods work such as spatial.procedures and spatial.addNode etc.
The error results after a call like this:
CALL spatial.withinDistance('profile_geo', [43.524, 96.7341], 500)
and the error that results is this:
Failed to invoke procedure `spatial.withinDistance`: Caused by: java.lang.NoClassDefFoundError: org/neo4j/cypher/internal/compiler/v3_0/commands/expressions/GeographicPoint
The same error appears when trying to use the closest function as well. Any help would be appreciated.

It looks that you are missing required Jar for GeographicalPoint class.
Please make sure you have this class in your Jars. I know this class exists in neo4j-cypher-compiler-3.0-3.0.3.jar but it is not going to work for you as it is residing in different namespace. If you will not be able to pinpoint the corresponding Jar in your environment please have a look at Maven repository and try to find it there.

short answer: upgrade to 3.0.3 (both neo4j and plugin)
long answer:
I ran into the exact same issue today. I was running version 3.0.2 with server plugin version 3.0.2 and ran the cypher query:
CALL spatial.withinDistance("spatial_records",{lon:20.0,lat:50.0},100000000)
Joran mentioned in the comments above that the REST API was a working alternative. So I tried that out and found he was indeed correct.
I tested this using httpie, with the following command:
cat tmp.json | http :7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance
where tmp.json looks like:
{"layer" : "spatial_records","pointX" :3.9706,"pointY" : 46.7907,"distanceInKm" :10000000000}
While this works, using CYPHER with stored procedures would be nice. So upon further investigation, I noticed that a recent commit contained the following changes:
- <neo4j.version>3.0.1</neo4j.version>
+ <neo4j.version>3.0.3</neo4j.version>
...
-import org.neo4j.cypher.internal.compiler.v3_0.commands.expressions.GeographicPoint;
+import org.neo4j.cypher.internal.compiler.v3_0.GeographicPoint;
So I ended up downloading version 3.0.3 of both neo4j and the spatial plugin. Whatever the issue was before, seems to be fixed in this version. The call to the stored procedure now works as expected!

Related

Circularity detected when running (vega:load-vega-examples)

When I load the vega-lite data sets using
(vega:load-vega-examples)
I get the following error:
Could not REQUIRE CL-DATE-TIME-PARSER: circularity detected. Please check your configuration
However, the examples appear to have loaded.
Also, before I installed cl-date-time-parser in quicklisp, I was getting an error message similar to:
Do not know how to REQUIRE CL-DATE-TIME-PARSER
Does anyone know how to get rid of these errors?
Many thanks!
The IMDB example requires cl-date-time-parser. I suspect that problem is that (require ...) only works when the library is in a location known to ASDF. In a new installation, this may not be the case. Now reported as issue #19.
Try loading the library with quicklisp and then rerunning load-vega-examples.

Failure to write edited values into new IFC file in WIT using ExportFileAsIFC using the same code as in the IFC.js Crash Course

When I attempt to edit an IFCBUILDINGSTOREY name value and write a new IFC file in WIT using the ExportFileAsIFC code from the IFC.js Crash Course IFC editing section, I get an error: Line object cannot be serialized:
Object { expressID: 138, type: 3124254112, GlobalId: {…}, OwnerHistory: {…}, Name: {…}, Description: null, ObjectType: {…}, ObjectPlacement: {…}, Representation: null, LongName: {…}, … } IFCWorker.js:87228:15. The value is definitely changed in the IFC data in the browser console output but it doesn't get written to the new IFC file. I cannot see any difference between my code and the course example code. The problem appears to be that the revised IFC data in the browser console output defines the storey as IFCBUILDINGSTOREY in the IFC.js course video but on my laptop the storey is defined as OBJECT in the browser console output. So I think it literally cannot serialize the non-specific OBJECT.
I have posted the project on my GitHub at https://github.com/quarto-zz/WIT2
Please can anyone tell me what is different?
Looks like a regression in web-ifc#0.0.36. We are looking into it. In the meantime, it should be solved by using the previous version by running the command: npm i web-ifc#0.0.35 web-ifc-three#0.0.118.
Solution found! In discussions with #ansoni on Discord at IFC.js the problem turned out to be two IFC library versions. The Crash Course videos show the library install commands for web-ifc and web-ifc-three as generic, which installs the latest version of each. The current versions of those two libraries cause a couple of issues, including the above problem. At this time, it is important to install the specific versions used in the Crash Course.
npm i web-ifc#0.0.35 web-ifc-three#0.0.118
You can check which versions you have currently loaded in the package.json file.
If you install the correct versions, be sure to replace the wasm and IfcWorker files locally, if you are already using them.
This will solve the above ExportFileAsIFC issue and also a failure to load an IFC file into a WIV scene issue.
The latest versions of these libraries that I had these issues with are:
web-ifc#0.0.36 and web-ifc-three#0.0.121

command line compiling generates bigger file than the online version

I am testing google closure compiler on command line.
I took the latest version :
java -jar closure-compiler.jar --version
Closure Compiler (http://github.com/google/closure-compiler)
Version: v20190618
Built on: 2019-06-21 17:24
I am generating a compressed version of my javascript like this :
java -jar closure-compiler.jar my_script.js > out.js
The problem is that the generated code is bigger than the one I get when I use the online service at https://closure-compiler.appspot.com/home
I noticed that the command line version added, at the beginning, the following code :
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(c.call(b,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
I do not have such a code in my script: Where does it come from ?
how can I produce the same output as the online version ?
To get the compiler command line work as the web service, I just added an option :
--language_out=ECMASCRIPT_2015
This is likely a discrepancy between the settings on the web service and the ones you're using locally.
Have a look at a Closure Compiler: Flags and Options to see what settings you might prefer.
If you'd share your source, it'd be possible to try and help you narrow down the options.
As for the extra code, I believe it is at least partially a polyfill for Array.prototype.find (aka [].find), which I assume is in your code?
If so, that's Closure injecting code to improve your cross browser compatibility.

RedundantNameQualifier error when Running Resharper CLI inspect tool

I'm using Resharper inspect CLI tool for static code analysis(JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe) on a dotnet core 2.1 console application I've created. Within the solution, there is a separate project which is just a package used in the console app.
Layout is as follows:
When I run the inspectCode.exe as follows:
JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe "AI.DL.Backup\AI.DL.Backup.csproj" /o:"CodeInspection_20222.xml" /profile:"AI.DL.Backup.sln.DotSettings"
I get the following issue:
Output xml report has the following:
<IssueType WikiUrl="https://www.jetbrains.com/resharperplatform/help?Keyword=RedundantNameQualifier" Severity="WARNING" Description="Redundant name qualifier" CategoryId="CodeRedundancy" Category="Redundancies in Code" Id="RedundantNameQualifier"/>
<Issue Message="Qualifier is redundant" Line="5" Offset="146-154" File="AI.DL.Backup\src\AI.DL.Backup\Startup.cs" TypeId="RedundantNameQualifier"/>
The problem seems to be that it cannot find the dll project referenced and is throwing code analysis error (code HAS been built already, so bin/obj folders exist with relevant dlls/packages required).
Ling 5 (as specified) is just the using statement for the separate package, which it cannot resolve and is deeming to be redundant.
using AI.DL.DocumentManagement;
using AI.DL.DocumentManagement.Stores;
Going by the generated XML report, I can see that it can't find the namespace within the separate package. Why would this be? Anyone seen this before?
I was able to work around this issue when I repointed the "inspect.exe" to my solution file instead of individual project!

premake5: Cannot get the "Hello World" example to generate a Visual Studio solution

I am trying to generate a solution file for the premake5 out of the wiki example.
https://github.com/premake/premake-core/wiki/Your-First-Script
Calling premake5 vs2012 produces the following error -
Error: premake5.lua:2: attempt to call global 'workspace' (a nil value)
Does anyone know how to fix that? It looks like premake5 does not recognize the workspace() function. I followed the installation instructions and assume that I downloaded and unpacked the console utility correctly.
Sounds like you are running an older version of the code. The workspace() call was just introduced and will appear in the next alpha release, which should come out sometime next week. In the meantime, just use solution() instead; your code will still work when the new alpha arrives.

Resources